Skip to content
This repository was archived by the owner on Mar 20, 2025. It is now read-only.
This repository was archived by the owner on Mar 20, 2025. It is now read-only.

Enhance slug control with field values as parameters #36

@jbmoelker

Description

@jbmoelker

Currently an entity's slug is has two customisation options: Slug directory and Slug item prefix which support variables like #T:

Current slug control options

This still limits urls to a "flat" structure always having the same base slug directory. To create more meaningful urls, I would like to have extended url customisation with the support of an entity's field values. For this I would propose a syntax like :[field_name].
If for example I have a blog-post with a field named category, I would like to be able to use the value of this category in the url. I would be able to to this by entering :category as the slug item prefix, like so:

Field value as slug parameter

If I would now create a new blog-post naming it Highest buildings and selecting the category Architecture, this would result in the slug blog/architecture/highest-buildings.

This would also be a solution for i18n support in the front-end. In your entity's definition you could at a field for language. In the slug you could use :language/blog. Since this would be an entity property in the templates as well you can also use it to set the lang attribute in the HTML.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions