Skip Navigation

[Resolved] Trying to use a nested shortcode to display a NextGen gallery with a types field

This thread is resolved. Here is a description of the problem and solution.

Problem: I am trying to use a Types field shortcode in a shortcode attribute for a NextGen gallery, but the gallery shortcode breaks and I see an error "We cannot display this gallery".

Solution: Use a Visual Editor cell to insert the gallery shortcode instead of a Post Content cell. Disable the_content() filter in the Visual Editor cell.

This support ticket is created 5 years, 9 months 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 6 replies, has 2 voices.

Last updated by jeffW-6 5 years, 9 months ago.

Assisted by: Christian Cox.

Author
Posts
#949209
Image of  resulting display.png
Image of nested shortcode used.png

I am trying to: I have a custom field in posts that contains the gallery ID of the NextGen gallery that corresponds to the post, I am trying to get that gallery to display when that post is selected. See attached image for reference.

Link to a page where the issue can be seen: hidden link

I expected to see: I want it to display the gallery the way it does using Toolset Views on the live version of the site, like this: hidden link

Incidentally, this functionality works great within the VIEWS part of Toolset. I am having the issue when I try to duplicate this within the LAYOUTS module.

Instead, I got: Unfortunately, I get the "Can't display the gallery..." message you see on this page of the production site where I am attempting a work-around: hidden link

I have tried many, many combinations of single and double quotes to get around this issue with no luck. Any guidance you can provide would be very appreciated.

#949325

Hi, can you tell me more about this?
- How is the View added to the Layout? For example, it could be in the body of a post and added with a Post Content cell, or it could be added with a View cell, or a Visual Editor cell and a Views shortcode.
- If you copy the Types field shortcode and paste it just before the ngg_images shortcode, is the gallery number displayed as expected?

#949335

Hi Christian,

Thanks in advance for your help.

To answer your first question, the layout has been added with a post-content cell.

And yes, pasting the Types shortcode before the NextGen code brings in the Gallery ID just fine. In fact, the "22" you see on the hidden link page is that very ID.

Let me know if there is any more light I can shed on the way it is setup.

Thanks,

Jeff

#950259
Screen Shot 2018-07-18 at 8.15.14 AM.png

Okay please try this instead:
- Remove the Post Content cell from the Layout
- Replace it with a Visual Editor cell
- Insert the Post Body into the Visual Editor cell using the Field and Views button
- Try with the "disable the_content() filter" box checked, then try unchecked

Let me know the results.

#950528

Christian = Genius

The "disable the_content() filter" option initially seems to have done the trick. I'll have more time to test it later and I will update the ticket accordingly.

Thanks again for your help.

Jeff

#951482

Great, let me know if the issue is not resolved.

#954433

Hi Christian.

I think I'm all set. Thanks again for your help.

Jeff

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.