SpinaCMS / Spina

Spina CMS
http://www.spinacms.com
Other
2.19k stars 405 forks source link

Customize the materialized path of a page #328

Closed TrueSoft closed 2 years ago

TrueSoft commented 6 years ago

It would be useful if the materialized path for a page would be editable. Now, it is generated after normalizing the title of the page. But there are cases when it is not done as expected.

  1. For instance, I have a page with the title "Noutăți", but the materialized path generated is "/nouta-i". Notice that ț becomes a dash, instead t.
  2. Another case when editing the materialized path would be useful, is if we have very long titles, but we want the url to be short.

I tried to change the value in the spina_page_translations database table, but unfortunately, it is lost on the next page edit.

Bramjetten commented 6 years ago

We try to do it the other way around. Paths are always generated based on your sitemap and titles. If you want to use a different title in your navigation for example, you can use the menu_title attribute for that. Changing titles automatically creates 301 redirects.

TrueSoft commented 6 years ago

I don't want to have a different navigation title than the page title. I just mentioned that the generated path is sometimes wrong, and it would be nice if we could correct it (like in case no. 1)

Bramjetten commented 6 years ago

I understand. I'd require a change to the way Spina generates the materialized path. Also: would you want to edit the entire path, or just the slug?

TrueSoft commented 6 years ago

The entire path, I think this is easier to implement. Because if a parent path changes, then all the children would remain with the old one. If it were to change their path, maybe it would break if one of them has already its path changed.

Bramjetten commented 6 years ago

Tbh, I think it's easier to use a separate slug field for every page. If left blank we can fall back to the page's title, but otherwise use the slug.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.