Skip Navigation

[Resolved] Displaying a View

This support ticket is created 2 years, 9 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: Asia/Karachi (GMT+05:00)

This topic contains 7 replies, has 2 voices.

Last updated by camila 2 years, 9 months ago.

Assisted by: Waqar.

Author
Posts
#2122503

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

#2122999

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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

#2123545

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

#2125161

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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.

#2126695

Hello! Any feedback on this issue? Thanks.

#2127575

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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/

#2127791

Thanks so much!!

#2127793

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.