Having trouble with on demand builder and permalinks #2605
lexoyo
started this conversation in
Uncategorized
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello dear community
I need some paginated pages to be rendered on demand with custom permalinks.
The initial data I have is this:
[ { "permalink": "/en/test1/", "lang": "en", "id": "test1-en" }, { "permalink": "/fr/test1/", "lang": "fr", "id": "test1-fr" }, { "permalink": "/en/test2/", "lang": "en", "id": "test2" } ]The permalink should has to be
/en/test1/for the 1st elementI can't find a way to do that, despite changing the data structure as explained bellow
What I tried #1
In
_data/d.json{ "/en/test1/": { "lang": "en", "id": "test1-en" }, "/fr/test1/": { "lang": "fr", "id": "test1-fr" }, "/en/test2/": { "lang": "en", "id": "test2" } }In
page.mdIt gives me an error (json.filter is not a function) because
/are not supported apparently - I could not find where is the matching made in the source codeWhat I tried #2
In
_data/d.json{ "test1": { "lang": "en", "name": "test1" }, "test1fr": { "lang": "fr", "id": "test1" }, "test2": { "lang": "en", "id": "test2" } }In
page.mdThis will not let me choose
idandlangfrom inside the object, this will match both/en/test1/and/fr/test1to the same object with keytest1:(What I tried #3
The only workaround I found is to use GET params in the URL to pass the ID and the language, so my urls are all messed up with GET for on-demand pages and a normal path for the other ones 😬
Any suggestions? I can change the data structure as it comes from directus.io headless CMS
Beta Was this translation helpful? Give feedback.
All reactions