Question

I have a page container that I want to pass the pageTitle into as a

This doesn't work:

    <dsp:getvalueof var="contentId" param="contentId" />
    <c:choose>
        <c:when test="${fn:contains(contentId, 'fol')}">
            <dsp:droplet name="FolderLookupDroplet">
                <dsp:param name="id" param="contentId" />
                <dsp:param name="elementName" value="folder" />
                <dsp:oparam name="output">
                    <dsp:getvalueof var="pageTitle" param="folder.name" />
                </dsp:oparam>
            </dsp:droplet>                  
        </c:when>
        <c:otherwise>
            <%-- Cover the default or empty scenario --%>
            <dsp:getvalueof var="pageTitle" value="Corporate Information" />
        </c:otherwise>
    </c:choose>
    <jsp:attribute name="pageTitle">
        <c:out value="${pageTitle}" />
    </jsp:attribute>

(Also doesn't help if you leave it as ${pageTitle} and I have confirmed that pageTitle is not empty)

But This does:

    <jsp:attribute name="pageTitle">
        <dsp:getvalueof var="contentId" param="contentId" />
        <c:choose>
            <c:when test="${fn:contains(contentId, 'fol')}">
                <dsp:droplet name="FolderLookupDroplet">
                    <dsp:param name="id" param="contentId" />
                    <dsp:param name="elementName" value="folder" />
                    <dsp:oparam name="output">
                        <dsp:valueof param="folder.name"/>
                    </dsp:oparam>
                </dsp:droplet>                  
            </c:when>
            <c:otherwise>
                <%-- Cover the default or empty scenario --%>
                Corporate Information
            </c:otherwise>
        </c:choose>
    </jsp:attribute>

The problem is. I don't want to have to call the droplet 3 times to get the other things I want to pass to other <jsp:attribute> tags. Is there a problem with scoping the pageTitle variable?

Note to those unfamiliar with ATG <dsp> tags: <dsp:getvalueof var="pageTitle" value="Corporate Information"/> is equivalent to <c:set var="pageTitle">Corporate Information</c:set>

Was it helpful?

Solution

Found another article which suggested it could be around spacing and comments within the page. Having removed any whitespace and comments between the <jsp:attribute> tag and the <abc:pageContainer> tags as well as moving the <c:choose> before the <abc:pageContainer> I now have a working page. Whitespace has not played a role as I added some whitespace back in. I suspect it is more to do with the page not getting compiled properly during an online edit.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top