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

IncludeTemplate Tag renders contentNodes twice

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 3.5.5
    • 3.5.4
    • taglibs
    • None

      If the Tag "includeTemplate" has the attribute "contentNodeName" as well as the attribute "path",
      the content is rendered twice:

      1) the standard template for the contentNodeName is used

      2) then the template of the attribute "path" is used

      example:
      <cms:includeTemplate contentNodeName="headlineWithRichText" path="../../../paragraphs/teasers/headline_with_rich_text.jsp"/>

      In my opinion, only one template should be used:
      if there's a path attribute, take the template of the path attribute, otherwise take the standard template of the contentNode

      When I look into the code of the File Include.java, there's following lines of code:

      if (this.path!=null)
      {
      // TODO
      log.warn("You are using the deprecated path attribute of the include tag. Your jsp will be included for now, but you might want to update your code to avoid bad surprises in the future.");
      pageContext.include(this.path);
      }

      ParagraphRenderingFacade.getInstance().render(content, pageContext.getOut(), pageContext);

      Wouldn't it be more correct to put the last line into the else branch of that if clause ?

        Acceptance criteria

              gjoseph Magnolia International
              killbill Jürgen Hirt
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: