Skip to content

How to use value from a nested relation in the preview URL #142

Open
@karel-suchomel

Description

@karel-suchomel

Hey,
can you get a slug from a relation and put int as a prefix to preview URL?

for example on the production, the URL would look like this: /brand/[brand-slug]/model/[model-slug]
I would have a model collection type related to the brand. How can I put the brand slug into the URL?
My plugin config would look like this:

{
    uid: 'api::model.model',
    draft: {
       url: 'http://localhost:3000/brand/{brand.slug}/model/{slug}',
       alwaysVisible: true
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions