Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-31130

{{ content }} variable not always available in twig template for custom tag

    XMLWordPrintable

    Details

      Description

      A normal custom tags in docbook looks like this:

      <eztemplate name="vcustom" ezxhtml:class="ez-custom-tag ez-custom-tag--content-visible">
             <ezcontent>
                 <para>custom tag content</para>
             </ezcontent>
             <ezconfig>
                (...)
             </ezconfig>
         </eztemplate>
      

      The ezxmltext->docbook converter will (if custom tag has no "content") leave out the <ezcontent>...</ezcontent> tag...
      This is fine according to RNG schema...

      However, if you in twig template for that customtag has {{ content | raw }} you'll get fatal error because variable is not set

      Also, if you in admin-ui creates a inline custom tag with empty content, that tag will also have no <ezcontent/> tag and you'll get the same fatal when rendering the template

      Reading the docs, you would expect the content variable to always exists...

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            vidar.langseid@ez.no Vidar Langseid
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: