Hi, i would create a menu in toolset where user can clic like a text link.
I'll explain better.
I have mixed taxonomy urls like
1° Taxonomy -> eventi
2° Taxonomy -> citta
I combined this urls like this:
hidden link
In the menu i succeeded to show certain link creating a views that shows terms like in the Eventi Menu
Eventi
- Eventi Aziendali
- Feste Private
- Cena Aziendali
Each link links to the desired url and it works:
E.G.
Eventi aziendali links to hidden link
Feste private links to hidden link
Cene aziendali links to hidden link
It works, but i can't hide links that doesn't exits, i need to show, in the menu, just the link that exist
E.g.
If there is no posts in Feste Private & Citta=roma it shouldn't show anything
Hello, the best way to do this without custom code is to use a View that acts like a conditional. It looks like you are creating the list of links now using a View of Eventi terms, is that correct? If so, you should keep displaying this View of Eventi terms, but instead of displaying the link in the loop of this View, you will display a nested View of posts. You should display the same post type that is currently displayed at the /eventi/eventi-aziendali URL. That View of posts should have two Query Filters: one for the Eventi taxonomy, and another for the Citta taxonomy. Both Query Filters should filter by taxonomy term slug, set by a shortcode attribute like wpveventi or wpvcitta. See the screenshot here for an example.
When you insert the posts View shortcode in your View of Eventi terms, you will add the current taxonomy term slug shortcode to the wpveventi attribute, like this:
[wpv-view name="Your Posts View" wpveventi="[wpv-taxonomy-slug]" wpvcitta="roma"]
I have added "roma" as the Citta term here, as well, to make the link dynamic. Add this View shortcode inside the loop of your current View of Eventi terms.
Instead of displaying posts in the loop of the posts View, remove all the contents from the wpv-loop tags. The loop should be EMPTY. Instead, somewhere inside the wpv-items-found section, display the /eventi/eventi-aziendali/?citta=roma link using the wpv-attribute shortcode to build the link URL dynamically with the current term slug:
<a href="<em><u>hidden link</u></em> name='wpveventi']/?citta=[wpv-attribute name='wpvcitta']"><em><u>hidden link</u></em> name='wpveventi']/?citta=[wpv-attribute name='wpvcitta']</a>
Remove the "No results found" message from the wpv-no-items-found section so it is empty. If no results are found, nothing should be displayed.
Let me know if you have questions about this and I'll give you some additional guidance.
Hi Christian, thank you.
i would try to do it.
To recap i should have 2 views:
1. Similar the one I made
2. Another one which is nested to the 1
I only can't understand where i have to put the
[wpv-view name="tipologia-eventi-menu-nested-posts" wpveventi="[wpv-taxonomy-slug]" wpvcitta="roma"]
Yes, your recap is correct. You should have two Views:
View #1 - similar to the one you already made. Let us assume this new View has the slug "new-eventi-terms-view".
View #2 - a new View of posts. Let us assume this View has the slug "tipologia-eventi-menu-nested-posts".
You should place View #2 inside the wpv-loop tags of View #1. Then you should place View #1 on the site where you want to display the list of links.
Sorry
I'm very confused 😀
It looks like something got corrupted in the new-eventi-term-view code when you copy + pasted the link code. Would you like to provide a login so I can help set this up? Let me know where you would like to display the list of links on the front-end of your site.
Okay I have the Views set up now. You can check the results here:
Eventi Aziendali: hidden link (both links appear)
Feste Private: hidden link (both links appear)
Eventi Aziendali: hidden link (only eventi-aziendali link appears)
Feste Private: hidden link (only eventi-aziendali link appears)
Eventi Aziendali: hidden link (both links appear)
Feste Private: hidden link (both links appear)
Look at the new-eventi-term-view here:
hidden link
You can see I am using the citta URL parameter (wpv-search-term gets the current URL parameter) to set the Citta Query Filter term slug:
[wpv-view name="tipologia-eventi-menu-nested-posts" wpveventi="[wpv-taxonomy-slug]" wpvcitta="[wpv-search-term param='citta']"]
This will only work in URLs with citta as a URL parameter like this:
hidden link
It will not work like this:
hidden link
If you want to support both URL formats, something needs to change, but I don't understand your site well so I'm not sure how that would work. We need a shortcode that represents "roma". In the Elementor template, you would replace the View widget with a text widget and place the View with a shortcode like this:
[wpv-view name="new-eventi-term-view" citta="[SOMETHING?]"]
Then in the new-eventi-term-view, you would change it to be:
[wpv-view name="tipologia-eventi-menu-nested-posts" wpveventi="[wpv-taxonomy-slug]" wpvcitta="[wpv-attribute name='citta']"]
But I don't know what SOMETHING? should be here. Do you understand what I mean?
Wow! It works
The website can take city taxonomy from the shortcode [citta-location-slug] now i'll try to implement it
Sorry i have a problem while inserting the shortcode in elementor it appears a "]
What type of block are you using? Elementor's "shortcode" block does not support nested shortcodes, so you should use a Text block instead. If you have trouble, please copy + paste the full shortcode here and I will take a look.
I used any types of block.
I also added [citta-location-slug] Manual Shortcode in toolset setting
If you need you can always enter in the admin to check
Ok i modified the view to use the view block. Now it seems to work
Yes it works, can you help to create a link badge to remove filters, or i need to create another ticket?
While visiting hidden link it has a 404
Yes it works, can you help to create a link badge to remove filters, or i need to create another ticket?
I can help, but a separate ticket would be best since this is a different topic. I'll split this and your question about Location posts 404 errors into separate tickets so we can discuss in more detail.