nlssn I think it would be awesome to have an URL like myflarum.com/my-page but still have it be a "Flarum link".
I don't think this is a problem with sijad's plugin, exactly. It's how core is configured and the plugin just uses that current config.
But this does raise a point that's been bothering me and it does need more consideration in general at the core. It probably needs a ticket raised to bring it to attention, but to get the idea out... Combining a title and ID in a URL is bad. That just makes it way more complicated to change/redirect URLs if a site owner needs to -- and they will. We don't need both in a URL, so it's either one or the other:
- title only, like @nlssn is suggesting; e.g.
site.tld/p/titles-like-this
, or
- ID only, e.g.
domain.tld/p/12
.
I have no problem with the /p/
part of the URL, and I recognise where that's coming from. It's a distinguisher from the other regions of a Flarum site, for example:
- discussion:
domain.tld/d/...
- user profile:
domain.tld/u/...
- page:
domain.tld/p/...
- tag:
domain.tld/t/...
- category:
domain.tld/c/...
(maybe in the future)
So I doubt those will change, and I think they are important to keep, as kind of site sections.
More important is going either titles or ID only.
Titles look better, and maybe offer an SEO advantage (a different discussion about metadata per individual discussion/page/profiles is warranted), but IDs have the distinct advantage of not breaking links if you change a discussion/page/user title, because the ID doesn't change! This is a major UX deal, because you don't want all your intra-site links breaking when titles change.
Similarly, another poor design aspect of URLs is that when you edit a page or tag title, for example, the URL version also automatically changes, and you have to remember to edit it back if you don't want the actual URL to change too. This is really bad! Once a page or tag (whatever) is originally created, only the readable title should change when edited, and not the URL, or you definitely risk breaking bookmarks that people likely made to your interesting/useful content.
Besides, I rarely want my readable titles to be exactly like my URL-only titles too. This is a more typical example to keep URLs more concise but usable:
- readable title: Four reasons for defining style and tone
- url-only title:
domain/tld/d/reasons-for-style-tone
So...
- Choose a better base URL pattern (either title or ID, but not both).
- Remove that annoying auto-change behaviour on published URLs when editing the readable version. (If people need the URL changed too, they can just edit it manually as well, which is much safer to avoid breaking links/bookmarks, and encourages more control over the URL-only titles they want).
Without getting into a different discussion about better metadata handling per content item (i.e. meta-titles, meta-descriptions, etc), using the ID is probably the easier solution (e.g. domain.tld/p/12
), but it needs considered one way or the other.