[opencms-dev] designing own templates

Olivier Camus olivier.camus at steria.com
Wed Jan 9 10:44:10 CET 2008


Quickly, to do that :

---> Design your template and install it in the
system/module/my.package/templates/
(elements of the templates will be placed in
system/module/my.package/elements/
Use "create module workplace" functionnality in the workplace.

---> the template main jsp (the one you put in the /templates/ folder)
must be like :

--------------------------------------------------------------------------------
<cms:template element="header">
<!-- ### HEADER ### -->
	<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
	<HTML>
	<HEAD>
	<TITLE><cms:property name="Title" escapeHtml="true" /></TITLE>
	<LINK
href="<cms:link>/system/modules/my.package/resources/style.css</cms:link>"
type="text/css" rel="STYLESHEET">
	</HEAD>
	<BODY>
	<TABLE id="elementsTable" align="center" valign="top">
		<TBODY>
			<TR>
				<!-- bandeau -->
				<TD class="elementsTableRight" valign="top" colspan="3"><cms:include
page="../elements/head.jsp" /></TD>
			</TR>
			<TR>
<!-- ### END HEADER ### -->
</cms:template>
<cms:template element="left">
<!-- ### LEFT ### -->
					<TD class="elementsTableLeft" valign="top"><cms:include
page="../elements/left.jsp" /></TD>
<!-- ### END LEFT ### -->
</cms:template>
<cms:template element="pageBody">
<!-- ### BODY ### -->				
					<TD class="pageBody" valign="top"><cms:include
page="../elements/body.jsp" /></TD>
<!-- ### END BODY ### -->
</cms:template>
<cms:template element="right">
<!-- ### RIGHT ### -->					
					<TD class="elementsTableRight" valign="top"><cms:include
page="../elements/right.jsp" /></TD>
<!-- ### END RIGHT ### -->						
</cms:template>
<cms:template element="footer">
<!-- ### FOOTER ### -->
			</TR>
			<TR>
				<TD class="footer" colspan="3"><cms:include
page="../elements/footer.jsp" /></TD>
			</TR>
		</TBODY>
	</TABLE>
	</BODY>
</HTML>
<!-- ### END FOOTER ### -->
</cms:template>
--------------------------------------------------------------------------------
design head, left, right jsps as you wish.

body.jsp must be something like :

---> if you want to use direct edit in the page (the page will be
editable if you are logged in !)
--------------------------------------------------------------------------------
<%@ page session="false"%>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms"%>
<cms:editable />
<cms:include element="text1" editable="true" />
--------------------------------------------------------------------------------


--> else if you don't want the page directly editable
--------------------------------------------------------------------------------
<%@ page session="false"%>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms"%>
<cms:include element="text1" />  
--------------------------------------------------------------------------------

--> then, in your site part : (/sites/default/myssite/) create an
xmlpage (page with free text)
using just one row and one column (see line <cms:include element="text1"
/>  --> 1r,1c=text1 in xmlpages)
set template parameter to your template.
edit the page, put your text and take a look to the preview (or save,
exit, and click on the link).

Sorry I have not enough time to give more details.

Olivier

---- Messages d´origine ----
De: shrikants <shrikants at stplglobal.com>
Date: mercredi, janvier 9, 2008 10:10 am
Objet: [opencms-dev] designing own templates

> Hi List,
> 	I am using opencms 6.2.3.
> 	Please friends tell me the way to design own template using frames
> and including differents files at header, footer, body, left panel 
> thatmeans we are able to edit each of its body seperately.
> 
> Please help.
> 
> Thanks 
> Shrikant 
> 
> 
> _______________________________________________
> 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
> 



More information about the opencms-dev mailing list