Skip Navigation

[Resolved] How add rel to image in loop via toolset blocks

This support ticket is created 5 years ago. There's a good chance that you are reading advice that it now obsolete.

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by gille 5 years ago.

Assisted by: Luo Yang.

Author
Posts
#1502287

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

#1502723

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

#1503033
Schermafbeelding 2020-02-11 om 09.13.03.png

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

#1503057

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.

#1503121

My issue is resolved now. Thank you!