[opencms-dev] cms taglib questions

jeremy at paradoxcomponents.com jeremy at paradoxcomponents.com
Mon Jan 17 20:15:52 CET 2005


Hello:

I have successfully installed OpenCms 6.0 alpha 3, and am having some 
trouble getting the skeleton of a template to work.

In my site module's templates folder, I have the following jsp whose 
title is 'Default Template' and whose filename is default.jsp:

<%@ page session="false" %>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>

<cms:template element="head">

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><cms:property name="title" escapeHtml="true" /></title>

<meta HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; CHARSET=<cms:property 
name="content-encoding" default="ISO-8859-1" />">

<link type="text/css" rel="stylesheet" 
href="<cms:link>../resources/styles/default.css</cms:link>">

</head>
<body>

<h2>header</h2>

</cms:template>

<cms:template element="body">
<cms:include element="body" />
</cms:template>

<cms:template element="foot">

<h2>footer</h2>

</body>
</html>
</cms:template>
//end default.jsp

I created a new page (/sites/default/index.html) and selected 'Default 
Template' as the template, and added a bunch of text to this page.  When I 
view the page I get the following html:


<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>

<meta HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; CHARSET=ISO-8859-1">

<link type="text/css" rel="stylesheet" 
href="/opencms/opencms/system/modules/org.alf.frontend.template/resources/styles/default.css">

</head>
<body>

<h2>header</h2>









<h2>footer</h2>

</body>
</html>
//end html

Only the content from the jsp template is returned, and nothing that I put 
in the index.html page.  I must be missing something simple.  

Can anyone point me towards some documentation for the cms tag library, or 
give some insight into how the <cms:include element="body"/> tag finds its 
content?

Thanks,

Jeremy



More information about the opencms-dev mailing list