Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
karel-suchomel opened this issue Sep 20, 2024 · 1 comment
Open

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

karel-suchomel opened this issue Sep 20, 2024 · 1 comment

Comments

@karel-suchomel
Copy link

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
    }
}
@vincentgTroopers
Copy link

Hello @karel-suchomel is this what you are looking for : #69 (comment) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants