Forum
Filter Twice - Can you filter inside a template - content already filtered in pa...
We have setup the prev / next on a page with listing and detail view as per example recently posted: https://solutions.grabaperch.com/architecture/how-do-i-link-prev-next
The complexity comes about from how our gallery is setup, on one page, with 4 subcategories in this gallery that load inside divs that are hidden / fade on etc inside page, without navigating away.
The only issue we have, is that arrows to navigate to other items are loading on the page. So one item detail has 4 sets of arrows loading at the bottom or over the top.
So assume we need some kind of filter inside the prevnext.html template to only show arrows to other items if the slug matches the content region. As per how the filter is setup on $result = perch_content_custom array - although not sure how to add or if this would work - we did try...
Thanks for any help!
Are you asking if you can use multiple filters? See "Filtering by multiple fields": https://docs.grabaperch.com/docs/content/perch-content-custom/
Sorta I guess.... thought it might be an additional IF statement inside template.
So we can use this on the arrays you setup for prev/next?? Not sure filtering by slug here will get the result I want but can try.
AND
???
I can't answer your question, as it's not clear what you're trying to do.
I'm trying to stop the output of the navigation arrows of other regions in the other divs on the page. The lists for these other divs are not loading, only the navigation arrows - which is why (I assume) need to filter the prevnext.html template or the array by the slug??
The four div's have the code to list and load detail view and use unique string name and unset variable call. Everything works fine, except for the navigation arrows for detail view to link to next/pre item. All the other div navigation arrows are loading on page no matter what detail item is showing...
PHP page code:
So you're saying that under some condition, you don't wish to display previous and next links?
What is that condition?
Yes, currently it loads 4 sets of prev and next links on the page for the detail view of one item. So we only want the pre next links to show with links to other detail items within that repeating region. (There are four different regions with repeating items).
Test to see if you got a result before showing the previous and next links:
Hmmm... I added to gallery page, but no joy.
Is this correct:
Does the
echo $result['html'];
output anything?Yes. That part is all working fine, it's just the next/pre arrows from other regions that are outputting when we don't want them to.
Ok, so do you just need to reverse the logic?
I assume so... but thought we could have used some kind of IF statement on html template for arrows.
The complication has come about because we have 4 divs - each with this list/detail view. I used the below:
But the arrows till show on page underneath the current / active detail view. I guess because it's being pre rendered before page that the DIVs can't hide?
Sorry, I don't follow your question.
One the one page, there is 4 arrays for a list and detail view, each in a DIV. Code was pasted at start of steam here...
The list and detail view is all working, the only problem is the DIV's that are not "active" are still displaying their arrows for pre/next.
So I just need a way to hide these from outputting when the region they are related to is not displaying. The previous suggestion of wrapping in an IF statement didn't work.
As I don't have the running code, all I can do is make guesses about what's wrong. This is really beyond the scope of what I can help you with.