I have a toolset blocks page with a view and a repeatable image (dynamic from a custom post type).
All works good but I have Foobox and I need to add a rel parameter to the image in order to have next and previous on the lightbox.
The image is not using the lightbox of toolset blocks but a 3rd party lightbox that is triggered with a css class.
Can you help?
Thanks!
Gille
Dear Gille,
You can setup the HTML codes manually, for example, your custom repeating image field is "photos", you can add a shortcode block, and setup the HTML codes with shortcode [wpv-for-each] like this:
[wpv-for-each field="wpcf-photos"]
<a href="[types field='photos' size='full' url='true'][/types]" class="thickbox" rel="gallery">[types field='photos' title='%%TITLE%%' alt='%%ALT%%' size='thumbnail' resize='proportional' ][/types]</a>
[/wpv-for-each]
https://toolset.com/documentation/user-guides/views/views-shortcodes/#wpv-for-each
Hi Luo
Thanks for the feedback. But I've specified that I don't use views. I use Toolset Blocks in the Gutenberg editor. See screenshot of the image options.
Is there an option for adding a rel ?
Thanks
Gille
It is same to use Toolset Blocks plugin, there isn't such a built-in option to add "rel" attribute using GUI, you just need to try as I mentioned above, add a "Shortcode" block, with the codes I mentioned above.
Please replace "photos" with your custom image field slug.
My issue is resolved now. Thank you!