Skip Navigation

[Resolved] Transition from Views to Blocks

This support ticket is created 4 years, 11 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.

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: Africa/Casablanca (GMT+01:00)

This topic contains 3 replies, has 2 voices.

Last updated by Jamal 4 years, 10 months ago.

Assisted by: Jamal.

Author
Posts
#1717671

I've built Toolset-based sites in the past and had a break from developing a personal site. I'm back now, and see Toolset has moved on -- looking great and is the future but I've lost my way a little!

I had a view that queried the whole site for pages with certain categories, containing locations in custom fields. That was passed to a map.

In 'new' Toolset I can see the map, and the need to pass the query results from a block. Problem is I can no longer work out how to refine/drive the source data for the block.

So I have two questions, and these are on the new principles for Toolset:
1. When creating a block, how do I refine the source data -- for example display a block of all 'pages,' that include a 'location' field and appear in category 'X'
2. If I create this block, can I then hide on public view and use only the map? I realise I need the block to drive the map, but not sure I can hide that block

Thanks

Ben

#1718055

Hello Ben and thank you for contacting the Toolset support.

First, I would like to share our latest documentation and courses, we have published some lessons about the new Blocks experience:
- https://toolset.com/documentation/
- https://toolset.com/course-lesson/

Then, I'll try to answer your questions:
1. When creating a block, how do I refine the source data -- for example display a block of all 'pages,' that include a 'location' field and appear in category 'X'
I think that you are talking about the view query filters, the filters that instruct the view to return this or that post/page. Please use the block navigation button to locate the view Block(parent of all inside blocks(loop, filters, etc.)) and you can define the view query filters in the right section. Check this screenshot hidden link

Then you will have to choose the map block, select the markers options at the right, and configure it to pull the data from the view. Check this screenshot.

2. If I create this block, can I then hide on public view and use only the map? I realize I need the block to drive the map, but not sure I can hide that block
I believe you can. Otherwise, you can put the view loop elements inside a container block, then add a class to the container block and add a custom CSS to hide it.
Let me know if you find troubles with this, and I'll prepare an example for you.

I hope this helps. Let me know if you have any questions.

#1721117

Thanks for this.

So, if I want to, say show all pages that are the child of a specific page ID (not the current page) I'd have to use Views for that rather than Blocks?

I'm creating a new site (based on an old one) and want to use the current tools -- I assumed this would be Blocks.

I've also installed Views (to see if I can re-create your screenshot) but I can't run both View and Blocks at the same time.

Thanks

Ben

#1721679

Hello Ben,

I've also installed Views (to see if I can re-create your screenshot) but I can't run both View and Blocks at the same time.
Toolset Views and Toolset Blocks, are virtually the same plugin. That's why they can't be both activated, the last one activated will deactivate the first one.
You can still use Views while using Blocks, go to Toolset->Settings->General->Editing experience and activate both or just one of them.

So, if I want to, say show all pages that are the child of a specific page ID (not the current page) I'd have to use Views for that rather than Blocks?
You can do it with Blocks too. Check this screenshot for an example.
hidden link

I'm creating a new site (based on an old one) and want to use the current tools -- I assumed this would be Blocks.
You can still use legacy views. Indeed, we are still supporting legacy views.
But we encourage our clients to use the new block editor.

I hope this answers your questions. Let me know if you have any other questions.