Tell us what you are trying to do?
I currently have a map that shows a paginated list of entries on page load. I would like to change the view so on Page Load the map shows a set number of random entries. Once the user presses submit on a search it displays the results in a paginated form.
ON LOAD
Map
Search Bar
Random List of entries from directory
ON SUBMIT
Map
Search Bar (with search parameters)
Paginated List of results
Perhaps i'm missing something but this is how the map is currently working. On the page load it shows the entire list of markers and filters to the relevant markers once the user performs a search.
"Perhaps i'm missing something but this is how the map is currently working. On the page load it shows the entire list of markers and filters to the relevant markers once the user performs a search."
Yes that is how it is working now. How I would like it to work is on initial page load and before a search is performed it shows a random list of say 20 of the directory entries. Once a search is actually performed the page will show the requested results in paginated form.
Perhaps I am not explaining myself correctly. I do not have an issue with the makers showing up. All of my entries have addresses and the markers show up correctly when they are the result of the search.
I think this might help explain what I am trying to do. Let's act like there are 3 pages.
Page #1:
I would like to display 20 random entries from my map
Page #2:
I would like to display the first 20 alphabetical entries on my map. (This is what I currently have).
Page #3:
When this page loads, and before any search has been performed, I would like to display the map and entries like I have on Page #1. Once someone searches for something, I would like to display the map and results like Page #2.
I have a Many-to-One relationship. The parent is Domaines and the children are Labels. I have a view that view with a map, pagination and search. If I do a search for say the name of one of the children (Labels) currently it will only return the entry for the child (Label). I would like it to to show the the parent instead.
You can see what I mean if you go to this page: hidden link
Enter this into the search box (this is a child entry) : AKHASHENI (2015)
It returns the entry for just the AKHASHENI (2015). I would like it to return the parent of that entry instead.
I have created an admin account in case you need to look at the views or anything else.
Ok I can understand the map display issue. Thank you.
What if I removed the map? If I just had the search functionality. I enter a child into the search field and want the results to show the Child and the Parent of that child. Is that possible?
In a case like this your view is built to list out the child posts. Is it that you want to just search for the parent using the Child and not have your view display anything about that child ?
We can have this setup but you will need to tell your view to display the parent field rather than the current child. The main issue is that we can have duplicates in the results.
This means that anything that you're searching for if they have a shared parent then this parent will be listed twice.
"In a case like this your view is built to list out the child posts. Is it that you want to just search for the parent using the Child and not have your view display anything about that child ?" - Yes that sounds like what I want. I want people to be able to enter the Child or the Parent into the search and the result only displays the Parent.
"We can have this setup but you will need to tell your view to display the parent field rather than the current child. The main issue is that we can have duplicates in the results." - If I can get the view to work this way then I can work with the duplicates.
I have changed the password for the admin account. If you tell me how to send it privately I will send it over.
I was wondering if I might be able to get a suggestion on the above?
Just to be clear. My search currently displays Parent and Child. If I enter a Child into the search it will display that Child. If I enter a Parent into the search it will display that Parent.
What I would like to happen:
If I enter a Child into the search it will display the Parent.
If I enter a Parent it will display the Parent.
IF the above is not possible, is there a way to get it so when I enter a Child into the search it show both the Child and the Parent entries? Right now if I enter a Child it only shows the Child entry not the Child and Parent.
I am under a bit of a time crunch (of course lol) so anything you can do to make this work would be really appreciated it.
What I would like to happen:
If I enter a Child into the search it will display the Parent.
If I enter a Parent it will display the Parent.
So given that you have your view displaying both Parent and Child, there is no way to display only the parent, unless I set the view to only display the child and in that view I call the fields from the parent like this
[wpv-post-link item="@domaine-label.parent"]
However in a case like this where we use the child and call its parent's values instead we will get duplicate entries but this is the actual solution to your case.
Thank you I will give that a try. I have a question though. Because I am displaying both Parent and Child, when I enter the name of the Child, shouldn't it return the Child result and the Parent result? Right now if I enter the Child it will only return the Child result.
It won't if the field you are filtering by is not on the Parent post. If the filter you are using only applies to the child then only the child will display.
This is because you are not able to filter the Parent itself by the child field.