Skip Navigation

[Resolved] Workaround for Templates (Single Post)

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 jasonw-2 10 months, 2 weeks ago.

Assisted by: Waqar.

Author
Posts
#2675909

Tell us what you are trying to do? I am wanting to put a checkbox into my custom fields for my Businesses post type that would if checked, would use a different Business single Elementor template (as a premium listing). As of now I have made the premium template and it is showing but I have to change the conditions manually to show the premium template to specific businesses. I'm sure this is probably out of the scope of Toolset Support but along the way you all have helped me create some pretty incredible things over the years (at least incredible to me:) I didn't know if there was some simple code I could put into my functions file to make this happen or if it was too much of an ask. Only one way to find out so here I am. Thanks again for everything. Toolset has always had the best support team out there, bar none. <3

Is there any documentation that you are following? Not yet.

What is the link to your site? hidden link

#2676105

Hi,

Thank you for contacting us and I'd be happy to assist.

To suggest the most efficient way to achieve this, I'll need to see how this Elementor template is set up in the admin area.

Can you please share temporary admin login details, along withe link to the example post with this premium template?

Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.

regards,
Waqar

#2676455

Hey there, Waqar! Somehow I've lost connection to my database so until I can figure that out, this will have to be postponed. 🙁

Just giving you a heads up. Thanks for your previous help! If you have to close this until then, I understand. I'll be back in touch as soon as I solve this database issue. If it wasn't on AWS hosting, I'd already have it done. Thanks again!

#2676578

Thank you for sharing this update and take your time.

This ticket will stay open for a couple of weeks. In case it gets automatically closed, before you could follow-up, you're welcome to start a new one.
( you can include this ticket's link in it so that we have the background information )

#2677308

Hello, Waqar! 🙂 I'm back.. *Sorry it took so long.

Will you please give me a private reply box so I can get you the credentials.

Thanks as always for all your help. <3

*I did change domain names for the site. Just a heads up on that (if it matters).

#2677532

Hello and welcome back!

I'm setting your next reply as private so that you can share temporary admin login details.

#2677879

Hi Jason,

Thank you for sharing these details.

Based on some testing and research, here are my findings.

Currently on your website, the template for the single 'Businesses' posts is being controlled by the Elementor.

A Toolset content template named 'Loop item in Map' is also assigned to the single 'Businesses' posts, but it is empty and is being overridden by the Elementor's template, anyways.
( screenshot: hidden link )

Elementor Pro, out-of-the-box doesn't support conditional assignment of templates, based on the custom field values. But there is a paid extension 'The Plus Addons for Elementor' which does support this:
hidden link

Another alternate which doesn't involve another extension, is to not assign any Elementor template directly through the Elementor's theme builder so that the Toolset's assigned content template is used to display the single 'Businesses' posts.

Inside this Toolset template, you can conditionally load the required Elementor template through their shortcodes and Toolset's conditional display feature:
( ref: https://toolset.com/documentation/legacy-features/views-plugin/conditional-html-output-in-views/ )


[wpv-conditional if="( $(wpcf-premiere-listing) gte '1' )"]
[elementor-template id="2396"]
[/wpv-conditional]
  
[wpv-conditional if="( $(wpcf-premiere-listing) lt '1' )"]
[elementor-template id="82"]
[/wpv-conditional]

In the above example usage, when the value of the 'premiere-listing' field is greater than or equal to 1, it will mean that the checkbox is checked and the Elementor template 'Premiere Businesses' will be loaded.

Likewise, if the value is lower than 1, it will mean that the checkbox is not checked and the Elementor template 'Single Business' will be loaded.

I hope this helps and please let me know if you need further assistance.

regards,
Waqar

#2677930

Hi there, Waqar! 🙂

When I put in my credentials I thought.. I hope he doesn't look too close at my somewhat of a disaster putting this site together. 😂 I'm surprised I've made it this far to be honest. 🙂

I wish I got along better with blocks but it blows my mind apart (the UI vs. my Essential Tremor brain), even knowing that would probably be the best way to have built this, in hindsight. Thing is, the more I build this site the more I'm undoing having Elementor pulling fields, to achieve what I want. Live and learn.

That map template.. after looking at it, I think what I did was attached that content template to the map view. What I am now realizing is that I did not need to do that (beings how it's empty) to achieve putting the icons (businesses) on the map on the homepage. When I hit the scan button in the maps view, it shows it being used on the homepage and my /test page. I just tried to delete the content template and I can't see where / how to delete that. Any thoughts? Do I have to delete the view first and then recreate my map to be able to get ride of that map template?

I believe I understand the process you've given me with the 'The Plus Addons for Elementor' approach. Are you saying to make a Toolset content template for single business pages (undo the display conditions like you said in Elementor) and then in that template just put the shortcodes that you've created for me with Plus Addons Pro installed and it's as simple as that? Or do I have to set each field with their logic too?

I appreciate your help with this and thank you for your time <3

Jason

#2678094

I made that far more difficult on myself than need be. Lol.

Thanks so much for your help. You are greatly appreciated, Waqar! <3

The bonus was figuring out the rest of my questions in the process. :')