Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twig filter/method for generating phpcr URLs that work even if document is moved. #77

Closed
benglass opened this issue Sep 24, 2013 · 3 comments

Comments

@benglass
Copy link
Member

I dont know if this is the right bundle for this issue but I think there should be a built in way to embed links/urls to other routes in the CMF into the body of a PHPCR document that can be resolved to the correct URL for the page whether the page has been moved or renamed. This is a feature that other CMS's have, for example in MODx you can have something like in your content

<a href="[~14~]">A link to page with id 14</a>

And the CMS will expand that to the correct URL for the page of that id. This allows the end user to change page URLs without having to update links throughout their site. This may be possible for any documents that use the referenceable mixin as they have a unique id.

@uwej711
Copy link
Member

uwej711 commented Sep 25, 2013

When you use the RoutingBundle you can already use {{ path('', { 'content_id': '/cms/content/home' }) }}

@dbu
Copy link
Member

dbu commented Sep 25, 2013

@uwej711 i think ben is talking about wysiwyg content containing internal links.

@benglass i think the right bundle for this would be RoutingBundle. i was also pondering this idea once, not sure if i have any issue opened anywhere. the twig filter (i would filter, not function) sounds right. but additionally for handling editing, we need a doctrine listener that filters back any internal urls to the document id or symfony route name. that is a bit tricky as we would need to either handle route parameters or detect if such are used and then not replace the link. magnolia cms (a jackrabbit based java cms) is storing both the phpcr path and the uuid of a document in order to survive move operations and recreating a node (deleting a doc then creating it anew in the same location).
if we don't do that, frontend editing would break this functionality, and backend editing would need some special handling to insert links... replacing on storing is the most universal and most easy to use.

@benglass
Copy link
Member Author

@uwej711 I'm also talking about a way to create a link using a unique identifier that is not subject to change if the user changes the node name or path by moving it.

@dbu I'll move this to a new issue on the routing bundle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants