Change url structure collections page and product page (trade theme)

Change url structure collections page and product page (trade theme)

TOC-MR
Excursionist
31 1 6

Hi All,

 

I hope someone can help me with the following (i asked in the wrong part of the forum platform before). I know there is no easy way to change the URL structure as shown below; however, I hope someone can explain it to me very simple and with an easy walkthrough to get this done, either by editing the code or pointing out something I might have missed in Shopify. 

 

Examples urls

 

Collections:

Current url:
https://theonlinecollective.nl/collections/jbl-speakers

 

I want it to be:

https://theonlinecollective.nl/collections/jbl/speakers

Speakers needs to be a sub-collection of the main collection JBL collection and this should also be reflected in the URL. Also fine if the wording collections is not visible in the url structure, but not a must


Product:

Current product url:

https://theonlinecollective.nl/products/jbl-bluetooth-speaker-charge-5

 

I want the product url to be:
https://theonlinecollective.nl/collections/jbl/speakers/products/jbl-bluetooth-speaker-charge-5

 

So i want the collection and  sub collection added to the product url structure. Currently no collection is added to the url structure. Also fine if the wording collections and products are not visible in the url structure, but not a must

 

Thanks! R.

Replies 12 (12)

namphan
Shopify Partner
409 50 72

Hi @TOC-MR,

- For collection: That link can be used with product tags. Ex: https://theonlinecollective.nl/collections/growing-concepts-terrariums/Terrarium

With Terrarium is the tag of the product in the collection.

- For Product: it will be impossible, you can just use link: https://theonlinecollective.nl/collections/jbl/products/jbl-bluetooth-speaker-charge-5

 

Coffee tips fuels my dedication.
Shopify Development Service
Need help with your store? namphan992@gmail.com
TOC-MR
Excursionist
31 1 6

Hi,

 

this already better than it’s right now. How do you do this? And how does it work with tags? Since you don’t want to have all the tags in url

 

ex collection 

 

Ex: https://theonlinecollective.nl/collections/growing-concepts-terrariums/Terrarium

 

if i understand correct Terrarium is the tag. But where is growing-concepts-terrariums coming from? Just to understand how it’s built 

TOC-MR
Excursionist
31 1 6

For example the collection url ideally needed to be

 

Ex: https://theonlinecollective.nl/collections/growing-concepts/terrariums

 

namphan
Shopify Partner
409 50 72

Hi @TOC-MR,

It comes from the collection's products, you can refer to it: 

Screenshot.png

Coffee tips fuels my dedication.
Shopify Development Service
Need help with your store? namphan992@gmail.com
TOC-MR
Excursionist
31 1 6
namphan
Shopify Partner
409 50 72

Hi @TOC-MR,

Everything is possible. You just need to change the collection handle, or create a new collection. 

And then add tags to the products, you can use the corresponding links

Coffee tips fuels my dedication.
Shopify Development Service
Need help with your store? namphan992@gmail.com
TOC-MR
Excursionist
31 1 6

Hi, maybe it's me but on the live enviroment (chrome) the urls are not working yet, and don't see them reflected in the navigation. only when i click on above link

TOCMR_0-1719761955039.png

 

+ i noticed the tagging is visible in the meta data...

 

TOCMR_1-1719762405913.png

 

+ it's also not clear for me where the rules are added

namphan
Shopify Partner
409 50 72

Hi @TOC-MR,

There will be 2 steps:

- Link: https://theonlinecollective.nl/collections/growing-concepts-terrariums : It will be the link of the collection. 

- Link: /Terrarium : it will be the tag of the product in that collection.

Screenshot.png

Coffee tips fuels my dedication.
Shopify Development Service
Need help with your store? namphan992@gmail.com
TOC-MR
Excursionist
31 1 6

hi,

still some questions

-is this something automatic? 

-will it always use the first tag?

-Where in the backend are those rules added?

 

the tagging is stil visible in the meta data. See for example: below page meta data. I think it’s happening when you create a collection or adjust an collection

https://theonlinecollective.nl/collections/growing-concepts-terrariums/terrariums

 

TOCMR_1-1719769241262.png

 

 

namphan
Shopify Partner
409 50 72

Hi @TOC-MR,

It won't be automatic and you can use any product tag, not just the first tag.

Therefore, you can add any tag to it

Coffee tips fuels my dedication.
Shopify Development Service
Need help with your store? namphan992@gmail.com
TOC-MR
Excursionist
31 1 6

hmzz, i don't think that this is a soltution that is sustainable from a manual work and SEO perspective. However thanks for trying 🙂 I reverted to an old copy of the theme.

namphan
Shopify Partner
409 50 72

Hi @TOC-MR,

If you have any questions, you can contact me directly, nice to meet you

Coffee tips fuels my dedication.
Shopify Development Service
Need help with your store? namphan992@gmail.com