Skip Navigation

[Gelöst] How to define the size of the photo for the thickbox class

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem:
Display the custom repeating image fields as specific size, and add the thickbox CSS class to the image link
Solution:
It is possible within Views + Types shortcodes, for example:

[wpv-for-each field="wpcf-fiche-photos-secondaires"]
<a class="thickbox" href='[types field="fiche-photos-secondaires" output="raw"][/types]'>[types field="fiche-photos-secondaires" size="medium" url="true"][/types]</a>
[/wpv-for-each]

Above example will output medium size image, and link to the full size images, and with CSS class "thickbox" in the image link.

Relevant Documentation:
https://toolset.com/documentation/customizing-sites-using-php/functions/#image

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 2 Antworten, has 2 Stimmen.

Last updated by Pat vor 5 Jahre, 9 Monate.

Assigned support staff: Luo Yang.

Author
Artikel
#369278

Pat

Hello,

I'm using a thickbox class inside a [wpc-for-each] shorcode.

[wpv-for-each field="wpcf-fiche-photos-secondaires"]
<a class="thickbox" href='[types field="fiche-photos-secondaires" output="raw"][/types]'>[types field="fiche-photos-secondaires" size="thumbnail"][/types]</a>
[/wpv-for-each]

I would like to know how I can define the size of the photo the thickbox has to take into account. Some of the photos are very big and I would prefer to use only size="medium" in order to limit the display timing.

I tried to place [types field="fiche-photos-secondaires" size="medium" output="raw"][/types] but this has not changed anything.

Regards
Pat

#369509

Luo Yang
Supporter

Languages: Englisch (English ) Vereinfachtes Chinesisch (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Dear Pat,

Please try replace the Types shortcode from:
[types field="fiche-photos-secondaires" size="medium" output="raw"][/types]

To:
[types field="fiche-photos-secondaires" size="medium" url="raw"][/types]

And test again. more help:
https://toolset.com/documentation/customizing-sites-using-php/functions/#image
url:
'false'(default) | 'true'
true=output the url of the image instead of the html img tag.
Works with the size attribute to output the url of the re-sized image

#369516

Pat

Thanks Luoy.

I think you mean to place url="true" and not url="raw" !
Regards
Pat