Jahia Template Forum > Problem with internal...

0 (0 Good)
0 (0 Bad)

Problem with internal link

by  yeskarthik »  2012/09/04 06:44

When I use the following code : 

 

<c:if test="${jcr:isNodeType(menuItem, 'jnt:nodeLink')}">
           <c:url value="${menuItem.url}" var="pageurl"/>
</c:if>
 
I'm getting the URL where the nodeLink is present, but that URL returns a 404 when I use it in <a href="${pageurl}"> </a>
But, How do I find the URL of the original resource?
 
Thank you,

  (yeskarthik)

Number of messages  2
Registration date
0 (0 Good)
0 (0 Bad)

Re: Problem with internal link

by  rvt »  2012/09/09 18:00

Karthik,

try this : <c:url value="${url.base}${menuItem.properties['j:node'].node.path}.html" var="pageurl" />

When a page is a internal link (j:nodeLink) then the property that holds the page that should be generated for the URL is to be found in the j:node property.

Additionally, always add url.base when generating the url.

Ries

  • Re: Problem with internal link
    2012/09/09 18:01

    rvt <p> Karthik,</p> <p> try this :&nbsp;&lt;c:url value=&quot;${url.base}${menuItem.properties[&#39;j:node&#39;].node.path}.html&quot; var=&quot;pageurl&quot; /&gt;</p> <p> When a page is a internal link (j:nodeLink) then the property that holds the page that should be generated for the URL is to be found in the j:node property.</p> <p> Additionally, always add url.base when generating the url.</p> <p> Ries</p>

  • Number of messages  185
    Registration date Sep 9, 2012
    Contact
    Share
    Feedback

    Get in touch

    Whether you are a current user or if you are just evaluating Jahia, we are here to help.

    Contact us

    Share this page