Hello!
I am trying to display a view but I am having trouble getting the logic.
I have the following CPT:
1. Geo-Location.
2. Counties. (have a post reference that connects to the geo-locations)
3. Municipalities (have a post reference that connects to the counties)
4. Tax Sales. (have a post-relationship to select the municipality), the tax sales are also featured and members-only.
This is who is supposed to look like: hidden link
I want to show the tax sales by Geolocation under 2 columns: Featured and Members Only.
I already have the tax sales showing with the 2 columns:
URL: otsnew.flywheelsites.com
Login: develop
Pass: June2021
I am missing the Geolocation part. Any idea how can I do this?
Thanks
Hi,
Thank you for contacting us and I'd be happy to assist.
To achieve this, you'll need a series of nested views:
1. The parent most view let's call it "View 1", will be a view to show all the "Geo-Location" posts.
2. Inside this "View 1" loop, you'll nest a new view, "View 2" that will show all the "Counties" posts, which are related to the current "Geo-Location" post from the parent view "View 1".
3. Likewise, in the loop of "View 2," you'll nest a view, "View 3" that will show all the "Municipalities" posts, which are related to the current "Counties" post from its parent view "View 2".
4. Lastly, in the loop of "View 3," you'll nest a view "View 4" that will show all the "Tax Sales" posts, which are related to the current "Municipalities" post from its parent view "View 3".
It will be this "View 4" which will be responsible for showing the final output in two columns for Featured and Members Only.
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
Thanks so much for your answer and help.
I have it working!
Now I have another problem. I only want to show the Tax Sales (View 4), that have a tax sale date (which is a custom field) that is greater than today. I added that query in View 4, but now I get all the geo, counties, and municipalities with a "Not item found" message when there is not tax sale
please have a look:
URL: otsnew.flywheelsites.com
Login: develop
Pass: June2021
Thanks for the update and glad that it worked.
I see what you mean (on the page /tax-sales-properties/ ) and hiding the locations without "Tax Sales" posts, will require some custom code workaround.
Can you please share temporary admin login details, so that I can see exactly how the views are set up and suggest the next steps accordingly?
Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.
Hello! Any feedback on this issue? Thanks.
Thank you for waiting while I performed some tests.
I was able to hide the locations without any results, using these steps:
1. I wrapped the output of each level's view content template, in a special div container, so that they are easily distinguishable/identifiable.
( screenshot: hidden link )
Example:
<div class="view-1-container">
......
</div>
<div class="view-2-container">
......
</div>
<div class="view-3-container">
......
</div>
<div class="view-4-container">
......
</div>
2. Next, in the parent most view "Upcoming Tax Sales - View 1", I included the following script in the "JS editor", that checks for the existence of any "Tax Sales" result through the div with class "view-4-container" and if it is not found, hides all the parent level containers:
jQuery(document).ready(function () {
jQuery('.view-3-container').each(function() {
jQuery(this)[0 == jQuery(this).find('.view-4-container').size() ? 'hide' : 'show']();
});
jQuery('.view-2-container').each(function() {
jQuery(this)[0 == jQuery(this).find('.view-4-container').size() ? 'hide' : 'show']();
});
jQuery('.view-3-container').each(function() {
jQuery(this)[0 == jQuery(this).find('.view-4-container').size() ? 'hide' : 'show']();
});
});
Note: The custom code examples from our forum are shared to get you started in the right direction. You're welcome to adjust them as needed and for more personalized customization assistance, you can consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/
My issue is resolved now. Thank you!