Skip Navigation

[Resolved] Translating from one taxonomy to the other when clicking

This support ticket is created 3 years, 2 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 6 replies, has 2 voices.

Last updated by Waqar 3 years, 2 months ago.

Assisted by: Waqar.

Author
Posts
#2220843

not a problem, I have figured the layout part out now lol.

how would you recommend translating from one taxonomy to the other when clicking?

#2221121

Hi,

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

Can you please share some details like which translation plugin are you using and where exactly you'd like the taxonomies to be translated, on click?

I'll be in a better position to guide you accordingly.

regards,
Waqar

#2221345

https://toolset.com/forums/topic/multi-level-user-generated-content-app/

The above link was my original question.

What I now need to do is translate through multiple child taxonomy which are all nested in multiple views. As I said though all the info is available in the above link.

#2222045

Thanks for writing back.

I've read the information available on the other ticket, but, I'm afraid, I couldn't find anything about the "translation".

Perhaps you meant, 'transitioning' from one taxonomy term to another, on click?

It would be more efficient, if you could share the temporary admin login details, along with the link to this taxonomy view, so that I can understand how it is set up in the back-end.

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

#2223047

Thank you for sharing these details.

The layout and the functionality that you're trying to achieve are a bit challenging, but, it is possible by using some careful implementation.

1. View "Add new Model":

You'll note that in the "Loop Editor" section, I've removed the extra wrapping containers, because we'll need to nest the child terms views inside the loop of this view too.


[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
	<div class="container wpv-loop js-wpv-loop">
	<wpv-loop wrap="1" pad="true">
		[wpv-post-body view_template="loop-item-in-add-new-model"]
	</wpv-loop>
	</div>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]

When you'll visit the page ( {yourwebsite.com}/model-management-centre/model-manager/add-new-model/ ), you'll not see any difference in the layout and the cards for the parent level terms will be showing, in proper columns.

In the view's loop item content, I've added some conditional blocks:


[wpv-conditional if="( '[wpv-search-term param=level-1]' eq '' )"]
<div class="col-md-4 align-self-center">
<h2 class="text-hide"><a href="./?level-1=[wpv-taxonomy-slug]" class="page-link" style="background-image: url('[types termmeta='logo' size='medium' url='true'][/types]');width:300px;height:300px;background-repeat: no-repeat;background-position: center;">[wpv-taxonomy-title]</a></h2>
</div>
[/wpv-conditional]

[wpv-conditional if="( '[wpv-search-term param=level-1]' eq '[wpv-taxonomy-slug]' )"]
<div class="row align-items-center">
<div class="col-md-4 align-self-center">
<h2 class="text-hide"><a href="./" class="page-link" style="background-image: url('[types termmeta='logo' size='medium' url='true'][/types]');width:300px;height:300px;background-repeat: no-repeat;background-position: center;">[wpv-taxonomy-title]</a></h2>
</div>
</div>
[wpv-view name="add-model-child" limit="-1" offset="0" orderby="taxonomy-field-order" orderby_as="numeric" order="asc"]
[/wpv-conditional]

The first conditional block is shown, when the page loads without any term slug value available in the URL parameter "level-1", which is the default state. In this case, all the parent-level term cards will be shown. The link for each card will open the same page, with the clicked term's slug passed in the URL parameter "level-1".
( for example: {yourwebsite.com}/model-management-centre/model-manager/add-new-model/?level-1=test-company-1 )

When the page will reload, the second conditional block will make sure that only that parent level card is shown, whose term slug matches the value passed in the URL parameter 'level-1'. Within the same conditional block, the shortcode for the next level child terms view "Add Model Child" is also included.

2. View "Add Model Child":

In this view's query filter the option "Parent is the taxonomy selected by the parent Taxonomy View". So when this view will be shown it will only bring in the terms, where the parent term is the same as the term from the current loop item of the parent level view "Add new Model".

You can make similar changes to the loop editor and loop item content of this view and the next level views, to make it work for further levels.

I hope this helps and please let me know if any step or point is not clear.

regards,
Waqar

#2223269

Hi,

First of all THANK YOU so much. I am absolutely made up with that. You should make a tutorial for this as I am alsomost positive there would me many others whom want this kind of work around.

Would this work when I finally get to post type models to show the models assigned to these selected taxonomy?

This has helped me with the rest of my project and I am grateful. I can't wait to have it all working and to show the toolset community.

Thank you again for your insight and support.

#2224627

Thanks for the update and glad that my message helped.

> Would this work when I finally get to post type models to show the models assigned to these selected taxonomy?

- Yes, once each level of the "Gaming Systems" taxonomy has been selected in this setup, you'll have each level's term slug in the URL parameter.

After selection of the last level term, you can show a post view to show "Models", with a taxonomy query filter, so that only the results related to the term from the URL parameter are shown.