For now solution is to define request type from template in some request scoped
var.
I.e. in default template page.jsp
[code]<c:set var="extension" value="html" scope="request"/>[/code]
In xml template page-xml.jsp
[code]<c:set var="extension" value="xml" scope="request"/>[/code]
And parse this variable in paragraph definition.
[code]<c:choose>
<c:when test="${extension =='xml'}">
.....xml for the paragraph.....
</c:when>
<c:otherwise>
..... html for the paragraph .....
</c:otherwise>
</c:choose>[/code]
This looks ugly (btw, i didn't succeed in attempts to fetch request URL from
request variable). What would be a proper solution?
I have an idea of defining new paragraph renderer and pass paragraph
configuration there.
I.e. extend info.magnolia.module.templating.paragraphs.JspParagraphRenderer
which would make use of different scripts depending on extension used in parent
template.
--
Context is everything:
http://forum.magnolia-cms.com/forum/thread.html?threadId=7d8903f4-f499-4b18-bba9-935f7b6f962d
----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------