Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-5029

Components with areas does not behave as expected on a public instance: areas are displayed even if they are empty

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 4.5.9
    • None
    • None
    • None

      On a public instance, components that have in their configuration areas defined do not behave as expected while this behavior is correct on the author instance.

      On the public, even if the area is not existing , the component displays it.

      Let's take an example.
      Open these pages
      http://demoauthor.magnolia-cms.com/demo-project/about.html
      and
      http://demopublic.magnolia-cms.com/demo-project/about.html

      Inspect the HTML code of the "Standard Article" on both page.
      You will remark that on the public site you have an extra div where class is links.
      See the screenshot .

      Standard article is a STK Teaser, its configuration is stkTeaser.
      And you can see that it has an area linkList.

      And this area has as a template script /templating-kit/components/teasers/linkListArea.ftl that renders this HMTL code

      <div class="links">
          [#if (content.title)??]
             <${headingLevel}>${content.title}</${headingLevel}>
          [/#if]
          <ul>
              [#list components as component ]
                  [@cms.component content=component /]
              [/#list]
              [#if cmsfn.editMode]
      		    <li cms:add="bar"></li>
      	    [/#if]
          </ul>
      </div><!-- end links -->

      But why this code is rendered on public and not on author.
      By the way you can have a look at the JCR Browser Website, the content is 100% the same, there is no empty linkList node on public (that could lead to the same behavior).

      So I think that the problem comes from the tag cms.area.

      In internalPage.ftl

              [#-- Rendering the teaser's linkList --]
              [@cms.area name="linkList"/]

      The tag should not render the area linkList as it's not existing.
      Well it works on the author, but why not on the public?

        Acceptance criteria

              jsimak Jaroslav Simak
              sschmitt Samuel Schmitt
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD