-
☆ A M B ☆
- 209 Posts
I’m listing documents and web links using Ditto.
The documents have a TV file input, and their link needs to point to that file.
The web links need to link to the external website.
Is there any way to do this with Ditto? I can’t find any way to provide different chunks depending on the document type, or to embed this logic.
Thanks,
Peter
You could use PHx inside the template chunk like so:
<code>
[+type:is=`document`:then`<a href="[+fileLink+]">[+fileLink+]</a>`:else=`< a href="[+weblink+]">[+weblink+]</a>`+]
</code>
That should work. Essentially it looks to see if the doctype is a document and swaps a different HREF for it.
-
☆ A M B ☆
- 209 Posts
Thanks, I’ve yet to get into using Phx. I did the same thing the ’traditional’ way by writing a custom snippet.