View Full Version : is there a token for product image name?
erichar11
06-29-06, 09:53 PM
is there a token for product image name via OUI?
Also, where can one get a list of all oui tokens.
Vic - WolfPaw Computers
06-29-06, 09:58 PM
%VAR(Products.d.image)%
Will give you the image path.
Most of the tokens are made up from MIVA Database fields. Others like shortcuts can be found at www.openui.org/docs
Bruce - PhosphorMedia
06-29-06, 10:01 PM
tons of them...just go to the Product Headers and footers and check out the two drop downs above each text box...select Current product in the first drop down, and peruse the options presented...although, if you actually want the name of the image (you don't say what you are trying to accomplis) you can use:
%OUI%%VAR(Products.d.image)% for the relative path to the image
and
%OUI%%ASSIGN(g.ProdName|gettoken(Products.d.image, /, 3))%
%EXPR(g.ProdName)%
(asssuming the path is graphics/000000001/filename.jpg)
erichar11
06-29-06, 10:11 PM
%VAR(Products.d.image)%
Will give you the image path.
Most of the tokens are made up from MIVA Database fields. Others like shortcuts can be found at www.openui.org/docs (http://www.openui.org/docs)
vic, thanks but I'm looking for the product image name, not the path. I have a manually built url which points to a completely different directory. I just need the name. Any suggestions?
Vic - WolfPaw Computers
06-29-06, 10:13 PM
You would have to strip it out, since the database stores the path and image name.
Ah, the pitfalls of not using the standard directories for graphics.
erichar11
06-29-06, 10:32 PM
You would have to strip it out, since the database stores the path and image name.
Ah, the pitfalls of not using the standard directories for graphics.
vic, we actually use the standard directories for graphics. However we have a js function which grabs a larger image when clicked. Therefore we created a second directory which we store the larger image. The large image name (i.e image.jpg) is the same name as the image stored in the standard directory. I just need to get the name of the image file so I can append it to the path where the larger view image is stored. Make sense?
Bruce - PhosphorMedia
06-29-06, 10:45 PM
in that case...if the regular image is graphics/000000001/image-name.jpg and the large image is graphics/LargeImage/image-name.jpg, you can also use:
%OUI%%ASSIGN(g.LargeImage|glosub(Products.d.image, '000000001', LargeImage
Or use the previous to get just the filename
Vic - WolfPaw Computers
06-29-06, 10:45 PM
Sure, but what you could do - and makes more sense (at least to me) is to put the large size images in the same directory and use suffix like _lrg.jpg.
Then if you name the image by the product code, and use the Viking Template modules, you could use %prodcode%_lrg.jpg to represent the images.
Vic - WolfPaw Computers
06-29-06, 10:46 PM
One too many zeros in that example...
-Vic
in that case...if the regular image is graphics/000000001/image-name.jpg and the large image is graphics/LargeImage/image-name.jpg, you can also use:
%OUI%%ASSIGN(g.LargeImage|glosub(Products.d.image, '000000001', LargeImage
Or use the previous to get just the filename
Bruce - PhosphorMedia
06-29-06, 10:48 PM
true...true...however, if you have a LARGE number of files...it makes more sense to flip the directory name...but, eh, just a personal preference...
erichar11
06-30-06, 01:40 AM
As always, you guys are great. I got it working by just using the prodcode token and appending additional text to it. Thanks.
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.