plainblack.com
Username Password
search
Bookmark and Share

Random Image Path

This Macro, developed under WebGUI 6.2.9, works like a combination of the ^RandomImage macro and the ^i macro. 

It returns the path to a random file that is in a specific collateral folder.  It was developed so that background images could be rotated randomly.

To install, copy the file to the /data/WebGUI/lib/WebGUI/Macros folder.  Then edit your .conf file in /data/WebGUI/etc to add the new Macro to the list of Macros:

RandomImagePath => RandomImagePath, \

(add the back-slash when adding macros, unless the macro is the last one in the list.  I had to figure that out the hard way once upon a time).

Then restart the web server.

Usage: ^RandomImagePath("<collateral folder name>");

 

 

System RequirementsPlease be advised: this contribution was tested with something older than WebGUI 7.5. When this contribution was uploaded there was no field for the author to fill out regarding it's requirements.
Comments
4robbert: "
Nice macro! I used it before upgrading to 6.8.6. :)

In 6.8.X you can use the RandomAssetProxy and create a template for the images in the folder which only returns the file his URL.


 
"
DownloadRandomImagePath.pm RandomImagePath.pm
LinksNo Support Offered
Statistics Downloads: 377
Views: 6328
Rating: 4
Updated: 8/12/2005
Keywords macros
NavigationBack to the Bazaar
© 2018 Plain Black Corporation | All Rights Reserved