Random Image folder

Jaz

God how embarrassing that is such a simple solution - must have been having a blonde day   :oops:

Thanks :-D

kweitzel

Try:


<?php RandomImage ('/media/random_image/'.PAGE_TITLE.'/'); ?>


cheers

Klaus

Jaz

#1
Hi,

Just wondering if this is possible.  I have been using the RandomImage snippet successfully on one of my sites and am now re-developing another site using WB.  Is it possible to code the RandomImage call so that it uses a variable in the directory name (I want to use a different set of images on each page).

I basically need some help coding the call in index.php so that the photo source directory name includes the page title as a subdirectory added to it - then in my random_image directory I will have subdirectories named the same as each page.  My PHP is pretty crappy so I'm not sure how to add this. Sorry if this is a bit confusing I've tried to explain what I mean in code below  :|

I currently have
    <?php RandomImage ('/media/random_image/'); ?>


but need it to be
    <?php RandomImage ('/media/random_image/{value of PAGE_TITLE}/'); ?>


Could someone suggest how I go about this please ?