Details
-
Bug
-
Resolution: Fixed
-
Minor
-
2.1 Final
-
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">