Skip Navigation

[Resuelto] The flow

This support ticket is created hace 6 años, 1 mes. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Este tema contiene 14 respuestas, tiene 2 mensajes.

Última actualización por Akhil hace 6 años, 1 mes.

Asistido por: Nigel.

Autor
Mensajes
#1124365

Hi Nigel.

i am lost at how to plan for a site with this flow.

main page with taxonomies + filter+ results [limit to 10] . > when the taxonomy is clicked it should lead to its sub taxonomies and the rest remain same.

do i need to create a page+ layout to load the view with archieve + taxonomy page ? OR

when i do this i have one issue : duplicate of slug. how do i approach this pls.

thanks.

#1124599

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

It seems in these threads we are going around in circles a little, so let's be clear about what exactly you want to achieve, because adding custom rewrite rules to include taxonomies in post URLs etc. may just be complicating things and unnecessary.

main page with taxonomies + filter+ results [limit to 10]

This sounds like a custom search View (or custom archive).

What is it displaying? Posts or taxonomy terms?

Where is it being displayed? A View added to a static page, or its a custom archive displayed at the relevant URL (i.e. it is a post archive, or it is a taxonomy archive, meaning an archive of posts with the taxonomy term indicated in the URL, e.g. site.com/taxonomy-slug/term-slug/).

On a taxonomy archive the term is set by the URL, so you can't add filters for the same taxonomy, that would require a different approach (involving adding a View to a static page).

In any case, please state clearly what you would like to achieve (let me worry about whether it is possible or not for now), because I'm still unclear.

#1124662

Hi,

1. adding custom rewrite rules to include taxonomies in post URLs etc. > ive solved this using a plugin "custom permanent link" . solved for now.

#1124665

this page here : enlace oculto is a layout with view to display taxonomy [with filter Select taxonomy terms whose parent is the value set by the parent view.] on top and wordpress archieve below .

not sure if this is what youre asking. ?

#1124692

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

Screenshot 2018-10-10 at 16.09.00.png

Looking at that page, it is the archive for the rise-directory post type.

It looks like you inserted a View at the top of the archive, which is a View that shows the terms of the taxonomy "rise-directory-category".

Below this is the archive itself, including a search form, is that right?

If I click on one of the categories, e.g. services, it takes me to the taxonomy archive for the services term, at enlace oculto

As a taxonomy archive it shows the two posts with this category.

So, what next?

You want something similar on this category archive if there are sub-categories?

You can add another taxonomy View to the category archive in much the same way as on the rise-directory post archive.

You would need to include a Query Filter to specify the parent (which is determined by the taxonomy archive we are on), see the screenshot for an example.

#1125891

Hi , sorry i think i lost after some time with not touching toolset.

i have created a staging site to isolate all the custom post types to avoid any conflict.

its here: enlace oculto

i created 2 views [ categories & subcategories ] follwing this link :https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/#taxonomy-view-within-taxonomy-view But my requirment slightly differs ,.

1. display main categories, cliking the main categories lead to sub categories. it stops when there is no subcategories
2. the url should pickup category n subcategory, for that im testing the plugin : enlace oculto
is there any other menthod ? you mention its complicated and not worth it etc ?

3. How can all the url stay the same ?
currently taxonmy url produce: enlace oculto
listing url : enlace oculto

Pls let me know if you need to access the staging site. its ready.

Thank You .

#1125948

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

Sure, let me get credentials for the staging site from you, I've set up a private reply.

Please confirm what you intend to happen, based upon the following sample taxonomies:

main1			main2			main3
				  sub2-1		  sub3-1
				  sub2-2		  sub3-2
				  sub2-3			sub3-2-1
				  					sub3-2-2
				  					sub3-2-3
				  				  sub3-3
				  					sub3-3-1
				  					sub3-3-2

'main' are the top-level terms.

main1 has no sub-categories.
main2 has one level of sub-categories.
main3 has two levels of sub-categories.

On the first page we will display the top level terms as links.

Q1 - will you also show posts (that match any term) below these term links, or it should show no posts?

When someone clicks on main1 it should go to a page which displays the posts with the main1 term. There are no term links to show because there are no sub-categories.

If someone had clicked main2, it would go to a page which now showed the sub-categories sub2-1, sub2-2, and sub2-3 as links.

Q2 - should it show posts here below the links or no posts?

If someone had clicked on main3 it would go to a page which now showed the sub-categories sub3-1, sub3-2, and sub3-3 as links.

If someone clicks sub3-1 it would go to a page where it listed the posts with the term sub3-1 (because there are no further sub-categories).

If someone clicked either sub3-2 or sub3-3 it would go to a page that showed the sub-sub-categories as links etc.

Q3 - is that what you are aiming for?

This can mostly be achieved using standard taxonomy archives, with a View at the top to generate the sub-category links.

Q4 - can we set this up using archives, or do you have a good reason to want an alternative solution?

You can customise the permalinks—I can't tell you how to do that beyond pointing out where in the settings you can add your own rules—as long as they don't "break WordPress".

By that I mean if you create a rewrite rule to customise the URL of a taxonomy archive, WordPress should still recognise that it is displaying the archive in question at that URL. In which case creating custom archives using Toolset for those archives will also work.

#1126209

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

Screenshot 2018-10-12 at 12.55.09.png
archive-links.gif

I set up a demo on my local test site (I wanted to try using module manager so that you can import the structures and see how it is set up).

First, in the screen recording you can see me starting on the archive page for my Listing post type, and then clicking through the terms of my Sector taxonomy until I run out of sub-terms and am left with just the matching posts. (You can see the term hierarchy in the screenshot.)

So, to the details.

The starting page is the Listing post archive, which I set up routinely to show the post titles of Listing posts as links.

For the Sector navigation, I create a View "Listing top-level Sectors" and insert this before the loop, immediately after the wpv-layout-start shortcode.

This displays the Sector taxonomy terms as taxonomy archive links (with the wpv-taxonomy-link shortcode).

I only want to show the top-level links on this page, so I add a Query Filter "Select taxonomy terms whose parent is None."

When users click the links they will be taken to the taxonomy archive for the Sector term they just clicked.

So I create a second custom WordPress archive, for the Sectors taxonomy, which will show posts with the term set by the URL.

For the Sector navigation at the top I want to display terms which are sub-terms of the current sector (set by the archive URL).

So I create a second View, "Listing sub-Sectors", and I insert this before the loop in the Sectors taxonomy archive.

This also displays the Sector taxonomy terms, but has a Query Filter "Select taxonomy terms whose parent is the current taxonomy archive."

When there are no child terms left we don't want to output anything, so I delete the "No items found" text and output nothing.

That's it.

If you want to see these structures you can use Module Manager to import them, using this file: enlace oculto

(Go to Toolset > Export / Import to import.)

If you want to play with some sample data to achieve the same as in my screen recording, you can import the sample posts from here: enlace oculto

(Go to Tools > Import > WordPress Importer to import. Unfortunately it doesn't import the hierarchies of the taxonomy terms, so you'll need to edit them to set the parents as per my screenshot.)

#1126278

Thank you . ill check and revert soon .

#1126329

Hi Nigel . ive uploaded the sample content here. enlace oculto

i have few doubts,

1. cant i have the url in sync ?
example :

taxonomies is
enlace oculto .... cant i have it as

enlace oculto ?

listing name currrently:

enlace oculto can i have it as

enlace oculto ?

is this possible or its how wordpress is ?

#1126417

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

taxonomy-slug.png

Don't forget that WordPress uses the URL structure to try and work out what it should be displaying.

The post type slug ("listing" in this case) is used already for displaying custom listing posts.

If you edit the custom taxonomy Sectors and in the options you add a rewrite slug of "listing", you will get a warning. See the screenshot taxonomy-slug.

You could use something else, including... "listings" (i.e. not "listing" which is used for displaying the listing posts).

So that would take care of the first case.

The second case is using the taxonomy terms in the post URL (which you can do with standard WP posts and categories on the permalinks settings page using the %category% placeholder).

You need a custom rewrite solution for doing the same with CPTs, which I mentioned in one of your earlier threads about this.

This falls outside of what I can do for you, but there are quite a few resources about creating such custom rewrite rules if you search for them. This one seems to cover more-or-less your use case, for example: enlace oculto

(Or you may find a plugin that will allow you to do the same, in which case you'll just need to test it and see what works.)

#1126427

the whole issue allmost going to be solved.

i like the idea of adding s at the end of the taxonomies.

i manage to alter the permalinks using this 2 plugin combinations,

1. FV Top Level Categories - to allow wp to accept sub level categories
2. Custom Post Type Permalinks - for the custom post type url.

however i have one issue , not sure if this is a concern

the nice url now is : enlace oculto

but these gives 404.

enlace oculto
enlace oculto
enlace oculto

Thanks Nigel !

#1126560

Hi, will a snippet help to redirect the taxonomies url to archieve url with regex etc ?

from

enlace oculto >> enlace oculto
enlace oculto >> enlace oculto
enlace oculto >> enlace oculto

basically every occurance of listings >> sector for certain pattern.

#1127394

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

Sorry, but if you are using a combination of other plugins to modify the rewrite rules for your taxonomy and post type archives and finding that it is not working how you expect, you'd really need to contact the authors of the plugins to understand why not.

A URL such as enlace oculto is a taxonomy archive but where you have replaced the taxonomy slug sector to use the CPT slug listing. I already pointed out that if you try to use the CPT slug for a taxonomy archive slug Toolset will give you a warning message. If you use another plugin to go ahead and do it anyway and it doesn't work, then I'd say that is not unexpected.

You might need an expert in custom rewrite rules to help you with this last part. It is not specific to Toolset, so you could try asking a question on the WordPress stackexchange site (https://wordpress.stackexchange.com/) before contacting a developer.

#1127965

Sorry for the delay.
My issue is resolved now.

i am using the plugin method. so far so good. will not know the outcome till the site index with google.
Thank you!