Hello,
I have a very complex gallery and want to give each photo a class and phpthumb parameter with just one tv dropdown list menu.
Is this possible to do this with a snippet of phx?
It’s for MODx Evolution and i already use the phx phpthumb addon..
Example tv dropdown list menu named "image-size":
(I don’t know if it’s possible to use two tv’s together but this is just to illustrate what I want to accomplish)
- a horizontal 230x150==w230h150||
- b vertical 230x310==w230h310||
- c horizontal 470x310==w470h310||
When I select option
b then the output should be this:
<a class="[+image-size:class+]" href="#"><img src="[+album-cover:phpthumb=`[+image-size:parameter+]`+]"></a>
[+image-size:class+] results in output:
w230h310
[+image-size:parameter+] results in output:
&w=230&h=310
And this should be the final result:
<a class="
w230h310" href="#"><img src="
/image.php?src=assets/images/imagename.jpg&w=230&h310&hash=7b55d3"></a>
I hope you get the picture
Can someone give me an example on how to do this?
I would really appreciate it!!
Thanx in advance!!
Update:
I’ve got a temporary solution, but I think it would be better to do something snippet based, or is this technically a good solution?
[+phx:if=`[+cover-format+]`:is=`w230h150`:then=`[+album-cover:phpthumb=`&w=230&h=150`+]`:else=`[+phx:if=`[+cover-format+]`:is=`w230h310`:then=`[+album-cover:phpthumb=`&w=230&h=310`+]`:else=`[+phx:if=`[+cover-format+]`:is=`w470h310`:then=`[+album-cover:phpthumb=`&w=470&h=310`+]`:else=`[+phx:if=`[+cover-format+]`:is=`w470h470`:then=`[+album-cover:phpthumb=`&w=470&h=470`+]`:else=`[+phx:if=`[+cover-format+]`:is=`w470h630`:then=`[+album-cover:phpthumb=`&w=470&h=630`+]`:else=`[+album-cover:phpthumb=`&w=710&h=470`+]`+]`+]`+]`+]`+]
It would be better to have phx or a snippet just replace the w & h right? how can I do this?