[opencms-dev] get the link to the right page from the CmsResult -----> SOLVED
Borja Marcos Suarez
borja.suarez at fundacionctic.org
Tue Jun 14 16:45:32 CEST 2005
Hi All,
I found a solution for the CmsResult.getPath link problem.
I use the removeSiteRoot method as follows
<a href="<%=
action.link(cmsJspActionElement.getRequestContext().removeSiteRoot(cmsSe
archResult.getPath()))%>"> <%= entry.getTitle() %></a>
Bye,
Borja
-----Mensaje original-----
De: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] En nombre de Borja Marcos
Suarez
Enviado el: martes, 14 de junio de 2005 16:04
Para: The OpenCms mailing list
Asunto: RE: [opencms-dev] get the link to the right page from the
CmsResult
Hi Thomas,
It doesn't work for me. I tried with cmsJspActionElement.link wich
internally call CmasJspTagLink.linkTagAction also and it still writes
/sites/default.
Is there another way to get a link from a path like
/sites/default/myfolder/page.html????
I don't understand why usually the link tag works and when I use with a
path from a search result it doesn't work.
I would be very grateful if someone helps me.
Thanks,
borja
-----Mensaje original-----
De: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] En nombre de Thomas Kraft
Enviado el: martes, 14 de junio de 2005 14:10
Para: The OpenCms mailing list
Asunto: Re: [opencms-dev] get the link to the right page from the
CmsResult
Hi Borja,
hab you tried to pass the link through CmsJspTagLink#linkTagAction ?
This works great for me:
http://synyx.de/api/opencms6b3/org/opencms/jsp/CmsJspTagLink.html#linkTa
gAction(java.lang.String,%20ServletRequest)
H2h, Thomas
Borja Marcos Suarez schrieb:
> Hi all,
>
>
>
> In a jsp for searching contents I have:
>
>
>
> <dl>
>
> <dt><%=
entry.getScore()
> %>% - *<a href="<%= action.link (entry.getPath()) %>">*<%=
> entry.getTitle() %>*</a>*</dt>
>
> <dd>
>
>
> <strong>Modificado el:</strong> (<%= entry.getDateLastModified() %>)
>
> <br />
>
>
> <strong>Extracto:</strong><%= entry.getExcerpt() %><br />
>
> </dd>
>
> </dl>
>
> -----------------
>
> action is a CmsJspActionElement object.
>
> entry is a CmsSearchResult object
>
>
>
>
>
> This doesn't work because the getPath method returns a string
beginning
> with /sites/default
>
>
>
> Can anyone tell me how to get the right link from the CmsResult?
>
>
>
> I'm sure that it is very easy but my mind is not working fine today ;)
>
>
>
> Thanks in advance,
>
>
>
> Borja
>
>
>
------------------------------------------------------------------------
>
>
>
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please
visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
_______________________________________________
This mail is send to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please
visit
http://mail.opencms.org/mailman/listinfo/opencms-dev
_______________________________________________
This mail is send to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please
visit
http://mail.opencms.org/mailman/listinfo/opencms-dev
More information about the opencms-dev
mailing list