Home › Toolset Professional Support › [Resolved] Complicated site structure with combined categories and subcategories
Problem:
I am building a complex website structure for a client, but Toolset is blocking single-character slugs like /p/ and /m/, which I need for certain custom post types. I am using workarounds like /pd/ and /dm/, but would like to know how to use the rewrite parameter to set the correct slugs.
Solution:
Toolset allows using single-character slugs. After creating the custom post type, go back to the edit screen and update the slug to your desired one-character slug, such as /p/ or /m/. This should work without needing the rewrite parameter.
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.
This topic contains 7 replies, has 2 voices.
Last updated by Christopher Amirian 2 months, 2 weeks ago.
Assisted by: Christopher Amirian.
Hello!
To begin with, I would like to refer to the following 2 tickets that I created last year:
-https://toolset.com/forums/topic/displaying-brother-pages-dont-work/
-https://toolset.com/forums/topic/how-to-show-sibling-pages/
I may have given too little information there for you to be able to point to a solution, so I will now give a little more.
I am creating a website for a client with a very complex structure that I am unable to create in Toolset using the standard CPT creation function.
/ *********************************************************************************** /
The structure is as follow:
-Electrical Services-Electrician (subpage website.com/d/electrician/)
--Division by district (no subpage for this division)
----Elektryk - Bielany (subpage of website.com/l/electrician-bielany/)
----Elektryk - Ursynów (...)
----Electrician - Praga South (...)
...
--Division by electrician services (no subpage for this division)
----Electrical measurements (subpage website.com/u/electricial-measurements/)
----Electrical inspections (...)
----Electrical inspections (...)
...
-Plumbing services - Plumber (subpage website.com/d/plumber/)
--Division by district (no subpage for this division)
----Hydraulic Services - Bielany (subpage website.com/l/plumber-bielany/)
----Hydraulic - Ursynów (...)
----Hydraulic - Praga South (...)
...
--Division by plumber services (no subpage for this division)
----Repair and installation of faucet (subpage website.com/u/repair-of-faucet/)
----Repair and installation of sink faucet (...)
----Repair and installation of shower faucet (...).
...
-Small home repairs (subpage website.com/d/minor-home-repairs/)
----Repairing radiators (subpage website.com/u/venting-radiators/)
----Repairs and installation of radiators (...)
...
-Turnkey interior finishes (subpage website.com/d/turnkey-interior-finishes/)
----House finishes Warsaw (subpage website.com/u/house-finishes-warsaw/)
----Turnkey apartment finishes Warsaw (...)
----Finishings of apartments Warsaw (...)
...
-Dimensional furniture (subpage website.com/d/dimensional-furniture/)
--Division of furniture by type (no subpage for this division).
---Closets (subpage website.com/m/closets/)
----Corner cabinets (sub-site website.com/p/corner-cabinets/)
----Sliding closets with mirror (...)
----Sliding cabinets (...)
...
---Bookcases (subpage website.com/m/bookcases/)
----Bookcases for living room (subpage website.com/p/bookcases-for-living-room/)
----Bookcases-for-living-room (...)
...
--Division of furniture by room (no subpage for this division)
---Kitchen (subpage website.com/m/kitchen/)
----Kitchen countertops (subpage website.com/p/kitchen-countertops/)
----Fronts for kitchen cabinets (...)
----Kitchen drawers (...)
...
---Dining room (subpage website.com/m/dining-room/)
----Dining room tables (subpage website.com/p/dining-room-tables/)
----Dining room chairs (...)
...
/ *********************************************************************************** /
This structure was set by the SEO agency and we must stick to it. From what I understand:
-subpages /d/ stand for departments/categories,
-subpages /l/ stand for locations (landing pages),
-subpages /u/ stand for services (landing pages),
-subpages /m/ stand for subcategories of furniture/rooms,
-subpages /p/ stand for furniture products (landing pages).
The problem arises with linking all this using Toolset, because:
1) All of the above subpages will contain content that will be targeted to specific keywords (including category and subcategory subpages); these will not be typical archive pages.
2) The main categories have a division (e.g., electrician has a division by neighborhood and service, plumber has a division by neighborhood and service, furniture has a division by type and room, ...), which is very important in terms of later displaying lists of sub-pages from a particular section. What I mean by this is that all sub-pages are to display sister pages, sub-pages from a given department and pages from other departments.
For example:
2.1) The website.com/d/electrician/ is to display:
-list of all services - /u/ - only from this category /d/electrician/,
-list of all locations - /l/ - only from this category /d/electrician/,
-list of all other categories - /d/.
2.2) On the /l/eletrician-bielany/ page is to appear:
-list of all services - /u/ - only from this category /d/electrician/,
-list of all other locations - /l/ - only from this category /d/electrician/,
2.3) The /u/electricial-measurements/ page is to display:
-list of all other services - /u/ - only from this category /d/electrician/.
2.4) On the /m/closets/ page is to appear:
-list of all products - /p/ - only from this section /m/closets/,
-list of all other subcategories - /m/ - only from this category /d/dimensional-furniture/ and division "by furniture types" (subcategories from division "by room" should not be visible).
And so on...
I assume that I am nevertheless able to make this structure in Toolset.
The questions that come to me are, how to do it? What should be a category/taxonomy and what should be a CPT? How do I create the aforementioned lists of services, products, locations that will only display services/products from a particular department/category?
Hi,
From what I see, it is not possible to implement such infrastructure with Toolset.
As this needs a specific URL structure as you mentioned maybe if you could use the normal WordPress page and sub-page hierarchy maybe it is possible to create the content?
It will lose the ability to filter or search the content later if needed.
I think you can use Toolset to create the post types and categories but to show the content using the hierarchy and the URL structure you mentioned you will need to do custom coding.
You can consider using a developer for this:
https://toolset.com/contractors/
Thanks.
Damn, thanks for a quick reply, although I didn't expect such an answer.
I was looking for a solution and came up with some ideas.
What if I create a CPT /d/, /u/, /l/, /m/, /p/ and operate on categories or tags for each main division?
I will create the following categories: “Electrician locations”, ‘Plumber locations’, ‘Electrician services’, ‘Plumber services’, ‘Furniture types’, ‘Furniture by room’.
What I will do next:
2.1) The website.com/d/electrician/ is to display:
-list of all services - /u/ - only from this category /d/electrician/, -----Here I will display a list of services with the category “Electrician services”
-list of all locations - /l/ - only from this category /d/electrician/, -----Here I will display a list of locations with the category “Electrician locations”
-list of all other categories - /d/. -----Here I will display a list of all major departments, except the currently displayed department
2.2) On the /l/eletrician-bielany/ page is to appear:
-list of all services - /u/ - only from this category /d/electrician/, -----Here I will display a list of services with the category “Electrician Services”
-list of all other locations - /l/ - only from this category /d/electrician/. -----Here I will display a list of locations with the category “Electrician Locations”, except the currently displayed location
2.3) The /u/electricial-measurements/ page is to display:
-list of all other services - /u/ - only from this category /d/electrician/. -----Here I will display a list of services with the category “Electrician Services”, except for the currently displayed service
2.4) On the /m/closets/ page is to appear:
-list of all products - /p/ - only from this section /m/closets/, -----Here I will display a list of products, which will be in relationship with /m/closets
-list of all other subcategories - /m/ - only from this category /d/dimensional-furniture/ and division "by furniture types" (subcategories from division "by room" should not be visible). -----Here I will display a list of subcategories /m/, which will be in a relationship with /d/dimensional-furniture/ and will have the category “types of furniture”
Am I thinking correctly? Is it possible to create it this way, without involving an outside programmer who is familiar with Toolset?
Thank you!
Hi,
The problem is the URL creation and I honestly am not sure if it is possible to do that with Toolset.
See for example:
website.com/d/electrician/
This will have the D post type.
But if you add a category it will not go under D. the category will have a separate URL:
website.com/electrician/
From what I understand you can not force the slug of post type to go before the slug of the category.
Maybe I am wrong but that will need a manipulation of the WordPress permalinks.
So the idea of creating the post types and categories are ok but to show them with the URL structure you want might need a developer here.
Thanks.
Permalink structure is not a problem, as category pages will be excluded from indexing and a 301 redirect will be applied.
After many hours of thought, trial and error, I managed to create the required structure.
You wrote that it is impossible, so below I will show you (and maybe other users in need) how I did it.
I created the following CPT:
-Main services (/d/)
-Furniture departments (/m/)
-Target products (/p/)
-Target services (/u/)
-Target locations (/l/)
I also created the following taxonomies:
-Main categories
-Furniture categories
The main categories are used in CPT “Target Services” and “Target Locations” and look as follows:
-Electric in general
--Electrician locations
--Electrician services
-Plumber in general
--Plumber locations
--plumber services
-Small home repairs services
-Turnkey interior finishes services
etc...
The main categories are used in CPT's “Furniture Departments” and “Target Products” and look as follows:
-Places
--Kitchen
--Bathroom
--Dining room
-Types
--Closets
--Bookcases
--Commodes
etc...
The "Main categories" are assigned depending on whether we are dealing with a service or a location.
Furniture categories are assigned in this way:
-the parent category “Places” and “Types” is assigned in CPT “Furniture Departments”.
-the child's category is assigned in CPT “Furniture Products”
In this way, I was able to create all Views using category filters.
Wow! well I should say thank you for sharing that creative way.
I'm glad that URLs will not be an issue.
Thanks.
Well, unfortunately, I have a problem with permalinks, unrelated to the level of complexity of the structure.
Unfortunately, I am not able to set slug permalink /p/ and /m/, because Toolset blocks these letters.
I know that I could use the rewrite->slug parameter, but I don't quite know how.
'rewrite' => array(
'slug' => 'k',
'with_front' => false,
'pages' => false,
'feeds' => false,
);
Can you point me to a solution or code that will make this possible? I'm currently using slug /pd/ and /dm/ instead.
Hi,
I tested on my installation and Toolset allows single character for the slug:
hidden link
You can login yourself and check following the link below:
hidden link
After you create the custom post type. Go back to the custom post type edit screen and change the slug to the one you want and save and it works.
Thanks.