Skip Navigation

[Resolved] In widgets block editor add the toolset content template block with the newly created widget blocks wrapper template.

This support ticket is created 2 years, 3 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
- 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 5 replies, has 2 voices.

Last updated by Luo Yang 2 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#2437901

- How and where do you want to use "content template as a wrapper"?
inside a widget, using the WBE (Widgets Block Editor) for footer and header widgets areas.

since there are some issues with several toolset blocks in the WBE ->
i create a content template block for each widget area,
and use the content template Block Editor ( works with all blocks) to insert toolset blocks properly to each one of the Content temp'.
this way my client can still interact and control the widgets areas with the Blocks UI.

is this description explained my use case and question?

#2437905

Yes, you can use Toolset Content Template as the wrapper, and there is one thing need to pay attention to:
Toolset content template is for display post information, for example single post, you need to make sure it is in a single post/single post of custom post type.

#2438739

1. what about if the content template (via a content temp' block) is on the footer or other widget area,
while loading/displaying a page, TS custom archives...?

2. which of the plugin shortcodes, for getting fields values, is better to use in those cases of not a single CPT: Types, Views, Any...
as in what will be working for sure, when there are conditional display against user roles and types user custom fields -
types usermeta, wpv-user, wpv-current-user...
or should i use access shortcode especially for a user role check*?

* take in mind that the content template inside a widget is holding several conditional shortcodes, user meta checks, user fields, roles, and 3rd party + my own custom shortcodes - nested, and with views (mostly cached but also not)

#2438771

Q1) You can add "item" attribute into content template shortcode to specific a page/post, for example:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-body
[wpv-post-body view_template="my-ct" item="123"]

More help:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/item-attribute/
numeric ID points to the ID of the post from which you want to retrieve data.

Q2) Same as above, if you want to get specific post information, you can use "item" attribute in Toolset shortcodes.

#2439105

i'm familiar with using the types and the views shortcode attributes to get custom fields.

i know about the item,user_id... attributes and how to use them to target the right post (specific post by using id, or parent or current post...) - What i was asking about is to know about the limits of nesting shortcodes inside a not assigned content templates that is called from a widget area that is called by an action in the main template.

footer column widget area > content template block (with block editor) > several conditional (user role) blocks > several content templates

i know there is an issue of performance and limitations about nesting and using too many conditionals output -

so i wanted to double check my use case/ solution for using the normal Blocks Editor through Content Template with Blocks Editor
- the standart one, used in single-post/cpt -
i'm inserting some TS Blocks to a widget - what cannot be done with the new Widgets Blocks Editor (that is not fully supported by toolset yet - is there any kind of a roadmap for the TS-Blocks plugin to support new widgets block editor?)

i know i can simply use the old widgets classic editor (by using a plugin or custom hook function) for the widgets area -
but this specific client want to use the new widgets block editor with all kinds of blocks.

so what is recommended in order to avoid known issues and limitations when using this kind of nesting templates inside conditionals and inside other content templates

#2439217

For the new question:

so what is recommended in order to avoid known issues and limitations when using this kind of nesting templates inside conditionals and inside other content templates

You can use content template shortcode within [wpv-conditional] shortcode, for example:
[wpv-conditional ...]
Here display one content template shortcode
[/wpv-conditional]

Same as above, within above content template, you can content template shortcode within [wpv-conditional] shortcode.