[opencms-dev] Newbie: problem including files stored in moduleresources

Arian Abrahantes Quintana Arian.Abrahantes.Quintana at cern.ch
Wed May 9 18:37:04 CEST 2007


Hi Cristian y alexander:

Thank you very much everything works properly.

arian


-----Original Message-----
From: opencms-dev-bounces at opencms.org on behalf of Christian Steinert
Sent: Wed 5/9/2007 9:42 AM
To: The OpenCms mailing list
Subject: Re: [opencms-dev] Newbie: problem including files stored in moduleresources
 
You have to modify all links by using the opencms link management.
This can be done by putting <cms:link></cms:link> around any url of your
links or by invoking
CmsJspactionElement.link(...) for the link urls, before writing them
into your page.

Therefore, your example should more properly be expressed as either

	<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" <http://www.opencms.org/taglib/cms%22> %>
	<cms:link>/system/modules/org.opencms.mymodule/resources/style.css</cms:link>

or

	<jsp:useBean id="cms" class="org.opencms.jsp.CmsJspActionElement">
		<% cms.init(pageContext, request, response); %>
	</jsp:useBean>

	String resPath = "/system/modules/org.opencms.mymodule/resources/";

	<link rel="stylesheet" type="text/css" href="<%= cms.link( resPath + "style.css" ) %>">


The reason for this is, that you must help opencms so that it can
re-write links automatically, to handle things like static export
See the Alkacon taglib and scriptlet documentation for details

regards
christian
> Dear all:
>
> >From my previous post you can see I am a newbie to opencms 6. At the moment I am trying to import a layout from opencms  5 to 6. I followed the instructions on the manual pages (quite usefull) for migration issues. I make all the changes needed to get my template working (package definition mainly) everything fine but when in my template when I request the style sheet (under resources) I can not load it. This is the piece of code:
>
>
>
> String resPath = "/system/modules/org.opencms.mymodule/resources/";
>
> ....
>
> <link rel="stylesheet" type="text/css" href="<%= resPath + "style.css" %>">
>
> Page Contents are diplayed right but no style applied.
>
> any help would be appreciated. TIA,
>
> arian
>
> PS: Is there some problem with the mailing list search engine at opencms.org?. I always get an error when press "go" but when the result is blank. Is this only happening to me?
>   
> ------------------------------------------------------------------------
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev


-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 4276 bytes
Desc: not available
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20070509/4e89dfa7/attachment.bin>


More information about the opencms-dev mailing list