user3676604
user3676604

Reputation:

Symfony CMF - Create JS Change label attribute from page

I am working with symfony cmf on a cms page. Currently i am trying to edit the label property from a Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page object.

In my twig template i have the following:

   {% createphp page as="rdf" %}
       <h1 {{ createphp_attributes(rdf) }}>{{ createphp_content(rdf) }}</h1>
   {% endcreatephp %}

I dont really know how i can get this to work so that only the label changes. When i dump the rdf object it will just show me two properties underneath the _children property "title" and "body". When i try to enter rdf.label, it gives me the error that label is not an existing property. Maybe somebody has managed to solve this before and can help me out with it. I would be really thankful.

Upvotes: 0

Views: 65

Answers (1)

dbu
dbu

Reputation: 1562

The mapping is defined in this file https://github.com/symfony-cmf/SimpleCmsBundle/blob/master/Resources/rdf-mappings/Symfony.Cmf.Bundle.SimpleCmsBundle.Doctrine.Phpcr.Page.xml

The menu label is in the middle of the menu and thus hard to highlight as editable. This is a conceptual limit of frontend editing, that you can only edit what is visible as content. We have been discussing the idea of a metadata editor. It should be possible to write a plugin that triggers when you select an item of the Page type and shows a button in the toolbar to edit meta data. You would need to provide the additional meta data in the page, next to the other attributes and content. But I am not aware of any implementation or concrete example how this would be done exactly. If you end up doing this, it would be great if you can contribute your findings to the symfony-cmf-docs.

Upvotes: 0

Related Questions