Uploaded image for project: 'Magnolia Standard Templating Kit (closed)'
  1. Magnolia Standard Templating Kit (closed)
  2. MGNLSTK-983

Internal Teaser returns an image from a children of the target page, when the target has no image in its intro / header but has images in the main content.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Neutral
    • 2.0.x
    • 2.0.3
    • templates
    • None

    Description

      An internal teaser must returns the first image found in the target content pointed by the teaser if no teaser image was defined in target intro/header.
      This is what the javadoc of info.magnolia.module.templatingkit.templates.components.InternalTeaserModel.findImage(Node) says.

      The problem with the implementation of InternalTeaserModel.findImage is that when no teaser image is defined in the intro/header of the target, the first image found could come from a child page. And according the usage of an internal teaser, we expect that the image comes from an area of the target.

      InternalTeaserModel.findImage must first search in the areas of the target before searching in the subpages.

      How to reproduce

      • Create a page, add a text/Image with an image.
      • Create a sub page with an intro image.
      • On a third page, create a teaser where the target is the first page you created.
      • The teaser displays the image from the subpage and not from the text/image of the 1st page.

      Possible fix
      In my project, I override InternalTeaserModel.findImage and I sort the list of nodes in order to the areas are the first in the list.

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              Unassigned Unassigned
              sschmitt Samuel Schmitt
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: