Skip to content

Idea: support fallback value in preview_path #345

@greatislander

Description

@greatislander

I have common use case where I allow content editors to customize the url-safe title of a piece of content. So, I might have fields like this:

Image

The generated page here would be found at /example/; if the slug field was left blank it would be found at /an-example-post-with-a-long-title/.

The challenge here arises when configuring the collection's preview path; I can specify that the preview path should include {{fields.title}} or {{fields.slug}} but I can't get it to follow the logic of falling back to title if slug is empty. This would be a fantastic enhancement. Maybe there's already a way to do this but I haven't figured it out. Thanks in advance!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions