pimcore / pimcore

Core Framework for the Open Source Data & Experience Management Platform (PIM, MDM, CDP, DAM, DXP/CMS & Digital Commerce)
http://www.pimcore.com
Other
3.39k stars 1.43k forks source link

Base page for Staticroutes #1049

Closed chix closed 5 years ago

chix commented 7 years ago

It would be nice to have a Drag&Drop field in staticroutes table for optional base page (similar to the "target" field in redirects). Url path of set page would be prepended to the route.

Feature description

Let me know if you find this useful, I can send a PR for this feature.

Martin

dpfaffenbauer commented 7 years ago

There is a plugin for that, nor sure if it works with Pimcore 4:

https://github.com/dpfaffenbauer/pimcore-dynamic-routes

chix commented 7 years ago

Did not know about it, looks good :+1: . However it currently does not work with Pimcore 4, do you plan to update it? Also, from the plugin description I think it works a little bit different from what I'm proposing here, so I still think this could be added to staticroutes.

dpfaffenbauer commented 7 years ago

I don't have any plans in updating the plugin. But as far as I understand your need, the plugin should totally fit your need. You can create routes like in Staticroutes + adding a "Base-Document" to it. So once a Document gets moved, the route still works.

I guess the Problem with Pimcore 4 is ExtJs6 -> the Plugin was never used with ExtJs 6 before. But, Pull-Requets are welcome :)

PS: I don't take the credit for the plugin, I just uploaded it from the Old Pimcore 1/2 Plugin Repository to Github and made it work for Pimcore 3. Actually, I don't know the original author.

brusch commented 5 years ago

Although I understand the idea behind this topic, I think a setting for a single base document is not generic enough - e.g. when dealing with different language trees.

brusch commented 5 years ago

A solution that works quite well for us is using a custom templating helper (eg. objectUrl()), that tries to get the base path from properties (eg. newsPath or blogPath) of the current document and prepends it to the path. Another possibility would be to use a dedicated config object, that holds the information.