How to use Editables in twig?


#1

I’m using twig for my templates but the editables are not shown in backend?

Code for example:

	{{ pimcore_input('title_test') }}

In backend no editable input field is shown - why?

Thanks


#2

hi,

you have to use the renderTemplate function in your controller in twig.

Regards


#3

That’s it - thank you very much!


#4

@dpfaffenbauer

I know this is an old topic, but there is still some confusion for me.

I tried to achieve the same thing, but the editables won’t show up.

Do I need some special includes?

{{ pimcore_input('title_test') }}

The “title_test” is this a variable or just a dummy string?

Is this even possible, if you’re not on a document page? (E.g.: I wanna use it to create my own “New DataObject” Form)

Thank you for any help :slight_smile:


#5

no, its not possible when you are not on a document. But: You can inherit editables. So, for example, you have a document /en/products and a route /en/products/product~1, you can inherit editable information from /en/products.


#6

Inheritance is unfortunately not working for me.

{{ pimcore_input('copyright').setInherited(true) }} is providing “right click to overwrite” in the backend but no output at the frontend. Also the value is not shown in the backend.

Any ideas?


#7

try it like this

{% set copyright = pimcore_input('copyright') %}
{% do copyright.setInherited(true) %}
{{ copyright|raw }}

#8

Unfortunately this is also not working. I am using Pimcore V5.2.3.

Dump of copyright shows the Text on the parent but not on childs.

/de/
image

/de/ueber-uns
image

Search in DB will show only one entry in documents_elements named copyright.


#9

does your /de/ueber-uns page use /de as content master document?


#10

No, just the parent in the document tree.


#11

Yeah, thats why its not working, there is no inheritance in the document tree


#12

Ahhhhh, damn :cry: :slight_smile:
Then we will need to switch to a document property for that.

Thank you for clarifying!