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,
  • Problem with internal link
    2012/09/04 06:44

    yeskarthik <p> When I use the following code :&nbsp;</p> <p> &nbsp;</p> <div> &lt;c:if test=&quot;${jcr:isNodeType(menuItem, &#39;jnt:nodeLink&#39;)}&quot;&gt;</div> <div> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;c:url value=&quot;${menuItem.url}&quot; var=&quot;pageurl&quot;/&gt;</div> <div> &lt;/c:if&gt;</div> <div> &nbsp;</div> <div> I&#39;m getting the URL where the nodeLink is present, but that URL returns a 404 when I use it in &lt;a href=&quot;${pageurl}&quot;&gt; &lt;/a&gt;</div> <div> But, How do I find the URL of the original resource?</div> <div> &nbsp;</div> <div> Thank you,</div>

  • Number of messages  2
    Registration date Sep 4, 2012
    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