Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Ladylain committed Aug 13, 2024
1 parent feadf61 commit 569a370
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,31 @@ fields:
slug:
label: Slug
type: slugfield
link: page('blog', 'slug', 'url_param_1':'colum_name_1', 'url_param_2':'colum_name_2')
link: page('blog', 'slug')
preset:
type: slug
field: title
```
In this example, the `page('blog', 'slug', 'url_param_1':'colum_name_1', 'url_param_2':'colum_name_2')` function will generate a link to the 'blog' page with the slug as a parameter.
In this example, the `page('blog', 'slug')` function will generate a link to the 'blog' page with the slug as a parameter.

You can add as many URL parameters as you like, targeting the columns in your template by chaining `'url_param_1':'colum_name_1'` inside the `page()` function.

For example, you want to display link which has this format https://mydomain.com/:category/:slug
you can fill link in you YAML like this :
```yaml
fields:
title:
label: title
type: text
slug:
label: Slug
type: slugfield
link: page('blog', 'slug', 'category':'category_name')
preset:
type: slug
field: title
```

Please note: Relationships are not yet taken into account.

The slug is not saved directly when it is regenerated, so it is necessary to remember to save the form to keep it.
Expand Down

0 comments on commit 569a370

Please sign in to comment.