Skip Navigation

[Resolved] update view data using a search from another view

This support ticket is created 6 years, 10 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 5 replies, has 2 voices.

Last updated by Nigel 6 years, 9 months ago.

Assisted by: Nigel.

Author
Posts
#624077

Bob
pg-views.png

As you can see the page hidden link consists four parts.

1. a map
2. a filter
3. some text
4. rows displaying a custom post

1. and 2. are a view.
4. is the second view.
3. is a text section in Divi.

I would like to narrow the data in 4. related to the output of the filter in 2 (show addresses on the map and below as a row as well)... So no single view with all the items included. I would like to keep it separated as it is.

I hope this makes sense. I just can't seem to find the right way to make this happen.

Thanks in advance!
Bob

#624192

Nigel
Supporter

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

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

Screen Shot 2018-03-12 at 10.06.52.png

Hi Bob

You can use a single form to update two separate Views but it means running duplicate database queries and won't work with ajax updates, so if you can achieve the same in a single View it is better.

In your case I see no reason why you can't, except that you would have to move the text in between from a Divi text module and simply include it your View output.

See my screenshot for an example.

I have edited the Filter and Loop Output Integration Editor at the bottom so that it includes the shortcode for my map, then the View filter controls, then some arbitrary text I added, then the View results.

In my Loop Output Editor I insert the map markers and, in this simple example, just the post titles.

Ignoring stying issues, I then get the same order of results as per your screenshot, and if I use the distance filter both the map and the list of results update at the same time.

#624271

Bob

Hi Nigel,

Thanks for your feedback. I get what you are saying… one view… keep it simple 😉

The thing is that I really like the possibilities Divi gives me layout-wise. Want to change a layout element?… just grab it and put it where desired. (I’m a graphic designer you see).

I’ve reproduced your scenario, and it works fine as expected. But now I run in to the fact I want my map to be full width, while my table containing the resellers should be in line with the rest of my Divi grid… etc. Sure this can be fixed using CSS, but that kind of takes the flow out of my design process.

Also my idea concerning the text paragraph was that it should be client editable. Using Views, this won’t work I guess.

Since I’m not using Ajax and will be using a submit button I’m still interested in a work around.

…Or can I accomplish what I want (layout-wise) with Toolset templates/layouts? (I’m sponging through all the Toolset documentation… but I’m still learning). For a project I’m working after this one I have a layout in mind with filter options to the left and right of the output… I think I will run into the same obstacles here.

Would duplicate database queries be a real no no?

I hope you can make any sense of all of this 🙂

#624317

Nigel
Supporter

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

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

Hi Bob

Well you can go ahead and create two Views to insert where you like on the page.

Add the search filter controls to one of them.

Go to the top of the admin page to the Screen Options tab and make sure that the Query Filter section is enabled. Go back down and find that section, where you will see the actual filters added for the filter controls you inserted previously.

You need to replicate that same Query Filter (where the filter value comes from a URL parameter) on your second View, so that it is affected by the same URL parameters added by the filter controls of the first View, without duplicating the filter controls themselves.

Does that make sense?

#626704

Bob

Hi Nigel,

It does make sense 🙂 Thanks for helping out!

You may close...

#626960

Nigel
Supporter

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

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

Glad you got it working, thanks for confirming.