allow menu entries to point to content routes #132

Closed
dbu opened this Issue Jan 12, 2012 · 7 comments

Comments

Projects
None yet
3 participants
Owner

dbu commented Jan 12, 2012

currently a menu item can either do the things of KnpMenuBundle (including referencing a symfony route) or reference a content.
https://github.com/symfony-cmf/symfony-cmf/blob/master/src/Symfony/Cmf/Bundle/MenuBundle/Document/MenuItem.php#L35

we should add the possibility to reference a content route with phpcr-odm. this would handle the case where there is no content node but just a route specifying an explicit controller.
however, we have to be careful to make this work even if the ChainRoutingBundle is not in the namespace, to not create a hard dependency for people who don't use that.

/cc @uwej711

Member

uwej711 commented Jan 12, 2012

Isn't that just a special case of the symfony route? I never played with the ChainRouting so far but it would be cool to name those routes and have it working ootb? Does dumping routes work with chainrouting?

Owner

dbu commented Jan 12, 2012

the ChainRouting just delegates everything to its routers, and its complete, so everything works with chain routing.

however, our doctrine router ignores the name and uses the field 'route' in the parameters, missing that he looks if there is a 'content' in the parameters that implements RouteAwareInterface to find the RouteObjectInterface

if we come up with a route naming scheme that allows the doctrine router to find the corresponding route object just from the name, we can just as well just store the absolute path in the menu item, it will break if the route is moved around. whereas the reference would not break.

Member

uwej711 commented Jan 12, 2012

Say we named a route to a blog entry 'blog-post-23' why should it break when you move that around? But we could simply add another reference to the menu items that point to a node in the routing tree, that should work?

Owner

dbu commented Jan 12, 2012

do you mean a "name" property on the route object? how could we guarantee uniqueness? what about changing the name later? sounds like doing the uuid manually to me.

the reference to the node in the routing tree is probably the way to go here. but we need to be really careful with the interface so as not to break when the classes are not available.

Owner

lsmith77 commented Dec 1, 2012

is this still relevant?

Owner

dbu commented Dec 1, 2012

Yes it would make sense as right now you can Link content or named symfony routes, but not Route document by reference. Not critical though.

----- Reply message -----
Von: "Lukas Kahwe Smith" notifications@github.com
An: "symfony-cmf/symfony-cmf" symfony-cmf@noreply.github.com
Betreff: [symfony-cmf] allow menu entries to point to content routes (#132)
Datum: Sa., Dez. 1, 2012 12:37
is this still relevant?

Reply to this email directly or view it on GitHub.

Owner

dbu commented Apr 18, 2013

you can simple set the route with setContent

@dbu dbu closed this Apr 18, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment