You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a project when using React and SSR I'm having problems trying to use short URLs defined by sling mappings. The react router is configured to use the full page path provided by the PageImpl model. When using the dispatcher, the routes won't match the current page path showing a blank page.
It would be great if we can have an additional property with the mapped/short path too. Removing the initial /content/site is not enough when the sling mappings are more complex than just shortening the URL. Having this property would make really easy to modify the React route paths to consider the mapped path too:
At the moment my workaround to this issue is implementing a Jackson Module Provider that adds a property containing the mapped path to the PageImpl model and a custom Remote Content Renderer Request Handler to configure the Object Mapper instance.
Other alternative is implementing our own Page model, but this basically means duplicating a lot of code that already exists here. The PageImpl class is not exported by the bundle so I can't extend it and reuse its logic.
Any thoughts or suggestions?
Thanks
The text was updated successfully, but these errors were encountered:
In a project when using React and SSR I'm having problems trying to use short URLs defined by sling mappings. The react router is configured to use the full page path provided by the PageImpl model. When using the dispatcher, the routes won't match the current page path showing a blank page.
It would be great if we can have an additional property with the mapped/short path too. Removing the initial
/content/site
is not enough when the sling mappings are more complex than just shortening the URL. Having this property would make really easy to modify the React route paths to consider the mapped path too:At the moment my workaround to this issue is implementing a Jackson Module Provider that adds a property containing the mapped path to the PageImpl model and a custom Remote Content Renderer Request Handler to configure the Object Mapper instance.
Other alternative is implementing our own Page model, but this basically means duplicating a lot of code that already exists here. The PageImpl class is not exported by the bundle so I can't extend it and reuse its logic.
Any thoughts or suggestions?
Thanks
The text was updated successfully, but these errors were encountered: