I'm using Random_image_selective quite a bit and I have two questions.
1. When I use it within the page contents, it "loses" the directory information every time I go back to edit a page. It looks like this - "{random_image_selective dir=" alt="Mic " where the directory path and the closing brace have disappeared. Why? and can I prevent this?
2. One way I'm sure I could prevent this would be to move the Random image into the template, but is there a way I could then specify a different directory for each page?
Thanks!
Random Image question
Re: Random Image question
Need way more info...
Re: Random Image question
Hi Lylel,
check out this article:
http://www.i-do-this.com/blog/20/Random ... ith-Smarty
Replace
With
where $somevar will contain the various paths to the folders.
Then you can use $friendly_position to write something like
ps: if you want to use the same images folder for a certain part of your page tree you can use:
and it will match 2.1.1, 2.1.2, 2.1.3, ...
I just wrote this down without testing, let me know if you are having trouble implementing it and i'll test it further...
Greetings,
Manuel
check out this article:
http://www.i-do-this.com/blog/20/Random ... ith-Smarty
Replace
Code: Select all
{assign var='header_images' value='uploads/relative/path/to/images/*.*'|glob}
Code: Select all
{assign var='header_images' value='`$somevar`*.*'|glob}
Then you can use $friendly_position to write something like
Code: Select all
{if $friendly_position === "2.1"}{assign var="somevar" value="uploads/relative/path/to/images/"}
{elseif $friendly_position === "3.1"}{assign var="somevar" value="uploads/relative/path/to/images2/"}
...
Code: Select all
{$friendly_position|truncate:3:"" === "2.1"}
I just wrote this down without testing, let me know if you are having trouble implementing it and i'll test it further...
Greetings,
Manuel
Re: Random Image question
Thanks for responding Manuel,
I'm afraid your approach is a bit over my head.
I'm going to reformulate my question and try re-posting
I'm afraid your approach is a bit over my head.
I'm going to reformulate my question and try re-posting