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

Christian Steinert christian_steinert at web.de
Wed May 9 09:42:05 CEST 2007


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 --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20070509/8c8dc169/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3269 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20070509/8c8dc169/attachment.bin>


More information about the opencms-dev mailing list