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

Path for images and links not created correctly when not running as root context

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 2.1 Final
    • 2.1 Final
    • core, samples
    • None

    Description

      Magnolia 2.1 renders the path for images and links absolut, without
      taking the context into account. When magnolia is not installed as root
      context, the context path has to be used as prefix when images and links
      are referenced in the JSPs.
      I'm not sure whether this should be done in the getNodeData() method or
      should be left to the JSP developer.

      The current textImage.jsp is not working correctly when magnolia is not
      the root context, I think the attached patch should be applied.

      Index: /home/chris/workspace/magnolia-2.1/src/webapp/templates/jsp/samples/paragraphs/textImage.jsp
      ===================================================================
      — /home/chris/workspace/magnolia-2.1/src/webapp/templates/jsp/samples/paragraphs/textImage.jsp (revision 514)
      ++
      + /home/chris/workspace/magnolia-2.1/src/webapp/templates/jsp/samples/paragraphs/textImage.jsp (working copy)
      @@ -6,7 +6,7 @@
      <c:set var="imageurl">
      <cms:out nodeDataName="image" />
      </c:set>

      • <img src="${imageurl}" class="${imagedata.imageFloat}"
        alt="${imagedata.imageAlt}" />
        + <img src="${pageContext.request.contextPath}${imageurl}"
        class="${imagedata.imageFloat}" alt="${imagedata.imageAlt}" />
        </cms:ifNotEmpty>

      <cms:ifNotEmpty nodeDataName="title">

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              kraft Boris Kraft
              chrismenzel Christian Menzel
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD