Hi all,
I am at my wits end. I am trying to re-create the file path of an image using the alias of each folder via Ditto.
The path = assets/images/folder alias 1/folder alias 2/folder alias 3/IMAGE FILE IS HERE
As I couldn’t find placeholders within Ditto for what I need, I reverted to the
GetParent Snippet as it is extremely versatile and suits exactly that what I need.
My Ditto Call:
[!Ditto? &parents=`10` &display=`1` &depth=`3` &hideFolders=`1` &tpl=`RandomImage` &showPublishedOnly=`1` &randomize=`1`!]
My Ditto Template Chunk (RandomImage):
<img src="assets/images/[[GetParent? &field=`alias` &level=`2`]]/[[GetParent? &field=`alias` &level=`1`]]/[[GetParent? &field=`alias` &level=`0`]]/[+alias+].jpg" alt="[+longtitle+]" />
The Result Is:
assets/images////MYALIASNAME.jpg
As can be seen from the above, Ditto doesn’t process the GetParent snippet parameters. (I use the GetParent snippet outside of Ditto and it works perfectly.)
I have tried with various cached and uncached scenarios as well as a combination of caching and uncaching pages that display the call.
I am not a PHP’r and so am somewhat restricted when it comes to interpreting php.
If anyone can help that would be great.
Cheers for reading and thanks for any help