Skip Navigation

[Resuelto] Lightbox image gallery using Allow multiple-instances of this field

This support ticket is created hace 10 años, 1 mes. 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 6 respuestas, has 2 mensajes.

Last updated by Brent hace 10 años.

Assigned support staff: Luo Yang.

Autor
Mensajes
#24636

Hi following your relestate tutorial I was able to add multiple instances to a thumbnail field which works great.
I have tried to add rel="lightbox" to the shortcode, but I'm noticing the url is a combination of all the thumbnail urls.
example of url:
hidden link

website in question:
hidden link

Is there a way to set up a light box gallery like this, using the Add Multiple Instances? This would be Ideal that way the client could add as many images to the gallery as they wanted.

#24690

No one?

#24749

Luo Yang
Supporter

Languages: Inglés (English ) Chino simplificado (简体中文 )

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

Hi Brent,

Is this problem resolved? in your website: hidden link
I can see rel="lightbox" is set.
Please let me know if you need more assistance.

Regards
Luo

#24756

Well currently there is a set amount of images set that the client can add to each property, I really want to know how to do this type of thing with a one multiple instances image field, but I'm not sure how to go about it, I would love to know?

#24763

Luo Yang
Supporter

Languages: Inglés (English ) Chino simplificado (简体中文 )

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

You can try use Views shortcode "wpv-for-each" for your multiple instances field
https://toolset.com/documentation/views-shortcodes/#wpv-for-each
Iterate through multple items in a post meta field and output the enclosed text for each item

#28195

All good, used the code below in a view template:

<ol>[wpv-for-each field="wpcf-gallery-images"]

  • <a href='[types field="gallery-images" raw="true" link="false"][/types]' rel='lightbox'>
    [types field="gallery-images" link="false"][/types]
    </a>
  • [/wpv-for-each]<ol>

    #28200

    Final Code:
    [wpv-if field="wpcf-gallery-images" evaluate="!empty($field)"]
    <ol>[wpv-for-each field="wpcf-gallery-images"]

  • <a href='[types field="gallery-images" raw="true" link="false"][/types]' rel='lightbox'>
    [types field="gallery-images" link="false"][/types]
    </a>
  • [/wpv-for-each]<ol>
    [/wpv-if]

    (wpcf-gallery-images is a multiple instance image field.)