I imagine this is a simple enough thing. I just want to use the RoutingAutoBundle for nested pages.
I'm following along here http://symfony.com/doc/current/cmf/cookbook/creating_a_cms/
Say I have Page
documents which have a parent.
/**
*
* @PHPCR\Document(referenceable=true)
*
* @author Matt Durak <[email protected]>
*/
class Page implements RouteReferrersReadInterface
{
/**
* @PHPCR\Id()
*/
protected $id;
/**
* @PHPCR\ParentDocument()
*/
protected $parent;
//...
/**
* Get ID
*
* @return integer
*/
public function getId()
{
return $this->id;
}
public function getParent()
{
return $this->parent;
}
public function setParent($parent)
{
$this->parent = $parent;
return $this;
}
// ...
}
My auto routing configuration is like so:
cmf_routing_auto:
mappings:
Study\MainBundle\Document\Page:
content_path:
pages:
provider: [specified, { path: /cms/routes/page }]
exists_action: auto_increment
not_exists_action: create
content_name:
provider: [content_method, { method: getTitle }]
exists_action: auto_increment
not_exists_action: create
I would like something like the following. Assume I have my data like so:
/cms/pages
/page-1
/page-2
/page-A
/page-B
Currently, those 4 pages would have the following routes
/page/page-1
/page/page-2
/page/page-A
/page/page-B
I would like
/page/page-1
/page/page-2
/page/page-2/page-A
/page/page-2/page-B
I've tried adding another content_path
with the content_object
provider and calling getParent
, but that did not work. Is anyone familiar with Symfony CMF and the RoutingAutoBundle that knows how to do this? Documentation is sparse...