Skip Navigation

[Resolved] Filtering view based on shortcode attribute on content template

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 6 months, 1 week ago.

Assisted by: Minesh.

Author
Posts
#2698814
Screenshot_2.jpg
Screenshot_3.jpg
Screenshot_1.jpg

I am trying to add a shortcode to my themes 'Full Site Editing' (FSE) page template that filters on the current page ID.

I've created the view and have set the filter to show content based on the shortcode attribute. I then add the shortcode to my FSE page template.

The resulting page shows ALL results, not filtered on the current page, and include a piece of the shortcode at the end of the results: "]

There appears to be an issue passing attributes through a shortcode?

#2698911

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Yes - it seems to be issue with parsing the nested shortcode where you added the view with shortcode attribute filter.

What if you try to create a new content template "ct-for-article-photo-gallery-view" from Toolset => Content Templates and don't assign this content template to any post type and add the existing view shortcode you have to this content template and save the content template.

Later try to add the newly content template you created "ct-for-article-photo-gallery-view" to your site's FSE template.

[wpv-post-body view_template="ct-for-article-photo-gallery-view"]

More info:
- https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-body

Can you try to use the above solution I shared and check if that help you to resolve your issue.

#2698970

Thank you, this solution has worked for me.

I appreciate the help!