Skip Navigation

[Resolved] How do you create a view editable with the Block Editor directly?

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/Karachi (GMT+05:00)

This topic contains 4 replies, has 3 voices.

Last updated by Waqar 1 year, 1 month ago.

Assisted by: Waqar.

Author
Posts
#2665211

I use Toolset with Elementor, because I find that the Elementor editor is a lot easier to use than the default WordPress block editor. Creating views to be embedded within elementor is a bit frustrating for me. Is it possible to create a view, editable with the block editor, without creating a page?

It is simple to create a view directly by clicking on the add view button from within Toolset settings. This takes me to a wizard where I create all the filters I need for the loop, and it creates the view for me. This view lives independent of any pages, and can be added to any pages I need. The problem is, this creates all the design content in shortcode, and places it in a blank content template. To me, this seems like linking to a content template is essentially useless, because the actual toolset blocks are not editable, and I can't access the view loop from here.

If you create a page with the WordPress block editor, you can create a view on that page that has the WordPress loop built into it, and all the toolset elements you need looped can be edited in the wordpress block editor. But now, that view is directly tied to that specific page.

I'm not sure why the heirarchal structure for views created by the wizard, or within a specific page, are so different. Is there a way that I can directly create a view with a loop editable within the WordPress block editor, so that I can embed it on ANY page?

#2665343

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

Using a View block to create a View requires being in a block-editor context. Normally that means inserting the View block on a page, but that does imply creating a redundant page if you then intend to insert the View somewhere else, e.g. into Elementor content.

In this scenario I would suggest you create an empty Content Template instead of a page, and insert the View block there, in which case it can be designed wholly with blocks. The template doesn't need to be assigned to anything, it just servers as a "host" for the View block while it is being edited.

#2665531

Awesome thank you, that makes perfect sense!

I wish the process was a little more clear in the documentation, but now that you've clarified that, it's easy for me to move forward.

To be fair, this is less of a problem when you are already producing pages within the block editor, instead of swapping back and forth with Elementor, and Toolset is designed for the block editor, not for Elementor specifically(even though there are integrations with it).

Thanks again for all your help!

#2665589

One follow-up question. Using the content template works great for adding the views, but can I add a "view" that is not just a list? Can the content template itself be embedded in Elementor?

For example, lets say I'm using a toolset conditional to show a download link for a file, but only if that file exists in a custom field. Could I embed that in a view?

From what I undesrtand, this functionality already exists because at the top or bottom of a view loop, you are able to add content, that is then shown on the front-end through the view. But it seems a bit silly to create a view with an empty loop, and then just add stuff above or below it to display. I imagine having the unnecessary loop there is not good for performance.

That's sort of what I imagine a "view" functionality would look like. Toolset creating content that can be embedded in other areas of Toolset or elsewhere. A "view" being restricted to a list is a little confusing to me.

Sorry for the rant, I'm just trying to get a better understanding of Toolset, and it's functionality.

#2665741

Hi,

Thanks for the update and glad that Nigel's message helped.

Your observation is correct and it makes sense to only use a view, when a list of posts is involved. You can insert a Toolset content template inside the Elementor builder, using the shortcode 'wpv-post-body':
( ref: https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-body )


[wpv-post-body view_template="None"]

regards,
Waqar

#2666667

Awesome, thanks so much! That makes sense.