简体   繁体   中英

Replace '-' in slug array with '/'

So I've created my first website based on Bolt CMS and I can't fininsh one, last task.

The task is to make simple routes:

list of records from selected category - /realizations/cool-category

list of all records - /realizations/

single record - /realizations/cool-category/product1

I've managed to make it work but I can't manage to use record taxonomy (category) in routing file to set link like above.

I mean something like that : path: /{contenttypeslug}/{category_gotes_here}/{slug}/

Because of that, one (I guess horrible) idea appeared in my head - make slug use record title field and its category field.

Unfortunately slug's uses: [title, category] returns /title-category/ while I need /title/category/ format.

It there any way to make this one work? Or is there another, more valid way to add record category before its title in routing?

Bolt usually is not equipped to handle paths with more than one "/".

But you can expand the options with custom routes https://docs.bolt.cm/3.5/configuration/routing

For examples you can look at https://market.bolt.cm/view/twokings/hierarchical-routes - Or you can just use this extension to add more hierarchy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM