-
Improvement
-
Resolution: Done
-
Neutral
-
None
-
None
-
-
Empty show more show less
-
HL & LD 38, HL & LD 39
-
1
Currently in client side we need to add some parameters to call fetching pages:
https://git.magnolia-cms.com/projects/MODULES/repos/frontend-helpers/browse/samples/spa-react-minimal/src/App.js#32
https://git.magnolia-cms.com/projects/MODULES/repos/frontend-helpers/browse/samples/spa-react-minimal/src/App.js#33
It would be bit easier if could on client side to following:
add ALL query search parameters when fetching page from delivery endpoint
If preview iframe URL is: /travel/?mgnlPreview=false&mgnlChannel=desktop
Then URL to fetch pageswould be: some-url?mgnlPreview=false&mgnlChannel=desktop
If preview iframe URL is: /travel/?previewPersona=%2FSara-Byrne&mgnlPreviewAsVisitor=true
Then URL to fetch pages would be: some-url?previewPersona=%2FSara-Byrne&mgnlPreviewAsVisitor=true
Why it's good?
- it would allow us to get rid of methods on JS libs
- it would be future proof. Lets say we develop new feature that would do A, then on Magnolia side we would just attach query param to iframe preview URL, and client side would not have to be modified at all, as it would pass correct params already, and then our rest can look for them (think of it you could have already pass as query params selected variants for specific comps and make pages endpoint resolve it on Magnolia side, and you would avoid the variant choosing logic in client side libs)
- no extra work needed to support other framewroks/scenarios as it is all about passing query params, so on browser we know to use location.search, on e.g. next.js args.locations.search and so on. Developers would know how to pass the needed bit
Looks like for personalization you'd have to start adding `variants=all` to iframe preview URL.
- is depended upon by
-
MGNLFE-122 Update Angular and Vue demo project to display personalized content
- Open
- mentioned in
-
Page Loading...