Page 1 of 1

Make category part of page url, like http://domain/category/page

Posted: Mon Nov 11, 2019 1:55 pm
by padawan
Currently in my bludit installation (which is pretty much default) the url of the category is not part of a pages' url. Is there a way to change this, so that for a page that belongs to a category, the category name appears as a slug in the pages url? So that for example when the page "scrum-master" belongs to the category "skills", it´s url would be http://mydomain.com/skills/scrum-master"?

Regards,
padawan

Re: Make category part of page url, like http://domain/category/page

Posted: Mon Nov 11, 2019 5:45 pm
by Edi
No, Bludit has no such permalinks.

Re: Make category part of page url, like http://domain/category/page

Posted: Mon Nov 11, 2019 8:34 pm
by padawan
Okay, thanks for your quick answer again. Still a great CMS. I managed to build my own template from an HTML design I made before, even with some individual features I would consider "not beginners level", in just a few hours, with ease. Really fun to work with Bludit.

Re: Make category part of page url, like http://domain/category/page

Posted: Mon Nov 11, 2019 8:43 pm
by Edi
Thank you! Kudos to Diego.

Re: Make category part of page url, like http://domain/category/page

Posted: Mon Nov 11, 2019 9:04 pm
by padawan
Absolutely :)

As for the url slug, I just had the idea for a workaround. I could create a parent page for all pages of the category "skills", then declare all pages in that category child pages of it, and give the parent page a slug name similar to the one of the category... maybe like "category-skills". Then all child pages of the parent page "skills" would habe an url like e.g. http://mydomain/category-skills/scrum-master.

I tried it - it works, technically. Is there anything that speaks against doing so, from your point of view?

Re: Make category part of page url, like http://domain/category/page

Posted: Mon Nov 11, 2019 9:08 pm
by Edi
I thought also that this could have been made like this. But I do not know if this would affect SEO.

Re: Make category part of page url, like http://domain/category/page

Posted: Mon Nov 11, 2019 9:55 pm
by padawan
I could even check in the index.php of my theme if the parent page is being delivered, and if so, call the home.php template instead of the page.php template, that way having the parent page render a blog view of all pages in that category... and then, with simple str_replace(), rewrite the link hrefs of the listed category entries so that they contain the new url slug. Hm... I have to take some time to think about it 8-)

[EDIT]
I dropped the idea. It would in a way void the great advantage of Bludit and also of my theme that all parts of the code one really has to deal with when bulding a website are kept pretty simple. Maybe "url category slug as part of page url" finds it way on the list of features for future versions :)
[/EDIT]