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

Custom tags not rendered in preview when defined in siteaccess config

    XMLWordPrintable

Details

    Description

      When using the preview module from admin legacy for all custom tags implemented for ez5.x, the preview cannot show the same html parsed in the frontend site, e.g, a vimeo custom tag or an accordion custom tags works fine in the ez5 frontend, but in the admin preview this part fails, showing the xml block raw content, instead of the html5 converted markup:

      <custom xmlns:custom="http://ez.no/namespaces/ezpublish3/custom/" name="accordion" custom:identifier="Lorem Ipsum Identifier"><custom name="accordion-item" custom:title="Audience Response Lorem Ipsum"><p>Accordion Contente text <strong>ITEM 1</strong>: Lorem ipsum xxxx</p></custom><custom name="accordion-item" custom:title="Questions Writing Information"><a name="eztoc_1_1_1_1_1_1_1" id="eztoc_1_1_1_1_1_1_1"></a><h7>Accordion Content <strong>ITEM 2</strong>: Lorem ipsum xxxx</h7></custom></custom> 
      

      Update (eZ Support):

      When previewing eZ Publish 5.x custom tags on the backend, the preview doesn't show the converted HTML as is shown in frontend. Instead, it shows the raw XML content of the custom tag.

      Steps to reproduce:

      1. Prepare a test eZ Publish 5.4 installation, fully updated;
      2. In an override of content.ini.append.php, define the test "accordion" custom tag as follows:

      [CustomTagSettings]
      AvailableCustomTags[]=accordion
      AvailableCustomTags[]=accordion-item
      CustomTagsDescription[accordion]=Accordion (Container of accordion items)
      CustomTagsDescription[accordion-item]=Accordion Item
      
      [accordion]
      CustomAttributes[]=identifier
      CustomAttributesDefaults[identifier]=accordion
      
      [accordion-item]
      CustomAttributes[]=title
      

      3. Place the attached accordion.xsl file on a suitable location. In this test, it was placed on "/src/Nuno/TestBundle/Resources/accordion.xsl";
      4. Define the path to the custom "accordion.xsl" XSL file in ezpublish.yml:

      ezpublish:
          system:
              eng:
                  fieldtypes:
                      ezxml:
                          custom_tags:
                              - { path: %kernel.root_dir%/../src/Nuno/TestBundle/Resources/accordion.xsl, priority: 10 }
      

      Clear symfony cache afterwards. This will allow for the selection of two new custom tags - "Accordion" and "Accordion Item" - in a rich text / XML block field.

      5. Create a new article, and on the "body" field add a new "Accordion" custom tag. Inside, add some "Accordion Item" custom tags, with some text. In this tests, I called them "Test Item 1", "Test Item 2" and "Test Item 3", and then added some standard lorem ipsum text. With the editor disabled, this is the XML that was generated:

      <custom name="accordion" custom:identifier="accordion">accordion
        <custom name="accordion-item" custom:title="Test Item 1">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</custom>
        <custom name="accordion-item" custom:title="Test Item 2"> Phasellus interdum faucibus fringilla.</custom>
        <custom name="accordion-item" custom:title="Test Item 3"> Nunc sagittis eget dolor vulputate porttitor.</custom>
      </custom>
      

      6. Publish;
      7. Verify, on the frontend, that the custom tags are displayed properly (see attached "ez_support_issue_6021_screenshot_1.png" screenshot);
      8. On the backend, edit the article and preview it. You'll notice that it is very different from what is shown on the frontend. Instead of displaying the converted HTML, as would be expected, it displays the raw XML content of the custom tag (see attached "ez_support_issue_6021_screenshot_2.png" screenshot).

      Ref: http://share.ez.no/blogs/ernesto-buenrostro/how-to-create-custom-tags-in-ez-publish-5

      Attachments

        Activity

          People

            Unassigned Unassigned
            diegofa diegofa
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: