<div>Claus,</div> <div> </div> <div>Wonderful! Your template cod eis simply superb. However, I would like to add the Head navigation as well which will be different from the left nav. </div> <div> </div> <div>Example - Head navigation will include HeadNav1, HeadNav2, HeadNav3, HeadNav4</div> <div>When I click on HeadNav1 - Left Nav will be the sub pages in HeadNav1 folder</div> <div>HeadNav2 will have the sub pages in HeadNav2 filder and so on</div> <div> </div> <div>Head Navigation contains all images and I add this as a include file in the mytemplate.jsp. The problem is the navigation.jsp does not get displayed and the index.html in the site is blank. If I print the value of size of navList, it is 0. </div> <div> </div> <div>Your help will be highly appreciated. Pelase reply. Thanks, in advance</div> <div> </div> <div>-Twinkle<BR><BR><B><I>Claus Priisholm <cpr@codedroids.com></I></B> wrote:</div> <BLOCKQUOTE class=replbq
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Well, fiddling with manifests is not what I think of as a newbie <BR>thing... If all you need is to build a template that you can use for <BR>your pages it is not that complicated (though building templates can be <BR>one of the major efforts as the requirements for a site can make them <BR>quite complicated - templateone is such an example):<BR><BR>1. Go to the administration view, select Modules Management. Create a <BR>new module. Fill in the values, most important is the Package name, for <BR>this example: "my.module.name" (typically you would use a java package <BR>inspired naming strategy). The rest you can fill in as you see fit (or <BR>leave them blank), but do check all the suggested folders so it will <BR>create the necessary file structure for you.<BR><BR>2. Switch to the explorer view and the "/" site. Go to <BR>/system/modules/my.module.name. There you have the file structure for
<BR>the module. Go into the "templates" folder and create a new JSP - e.g <BR>"mytemplate.jsp". Set the Title-property to something useful, e.g. "My <BR>template", as it is the title you will see when you select a template <BR>later on when creating new pages for the site.<BR><BR>3. Enter the code, I've included a simple example. But despite its <BR>simplicity it shows most of the basic steps:<BR><BR><BR><%@page buffer="none" session="false" import="org.opencms.file.*, <br>org.opencms.jsp.*, java.util.*, org.opencms.util.*" %><BR><%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %><BR><%<br><br>CmsJspActionElement cms = new CmsJspActionElement(pageContext, request, <br>response);<br><br>if (cms.template("HEADER")) {<br><br>%><BR><BR><BR><BR><?xml:namespace prefix = cms /><cms:editable></cms:editable><BR><BR><BR> <TABLE border=1><BR> <TBODY> <TR><BR> <TD vAlign=top width="30%"><BR><cms:include page="../elements/navigation.jsp"></cms:include><BR></TD><BR>
<TD vAlign=top width="70%"><BR><%<br>}<br>if (cms.template("CONTENTS")) {<br>%><BR><cms:template ifexists="body"><BR><cms:include editable="true" element="body"></cms:include><BR></cms:template><BR><%<br>}<br>if (cms.template("FOOTER")) {<br>%><BR></TD><BR></TR><BR></TBODY></TABLE><BR><BR><BR><%<br>}<br>%><BR><BR>I prefer using scriplet code over taglibs, but that is just a personal <BR>preference (a dislike towards having to learn yet another syntax...) But <BR>actually you'll probably end up mixing them as you see fit...<BR><BR>The cms.template("XX") statements are not really necessary unless you <BR>plan using this template as a master for other similar templates <BR>(typically because you want to replace the CONTENTS part with some <BR>specific code rather than the text entered by the end user).<BR>But other than that it is probably the simplest template you can get <BR>away with: It includes the title-property of the page it is used on as <BR>the window title. It
includes a jsp script to build the navigation and <BR>finally it includes the body-element from the page. Also it enables the <BR>direct edit function (optional).<BR><BR>4. Just to make it fully functional, here's the navigation.jsp (put in <BR>the elements-folder). This is actually code to build a sitemap - you'll <BR>probably end up using the getNavigationXXX stuff differently to suit <BR>your needs for the navigation:<BR><BR><%@page buffer="none" session="false" import="java.util.*, <br>org.opencms.file.*, org.opencms.jsp.*, org.opencms.util.*" %><BR><%!<br>public void buildSiteMap(CmsJspActionElement cms, String uri, <br>java.io.Writer out) throws Exception<br>{<br> List navList = cms.getNavigation().getNavigationForFolder(uri);<br> if (navList.size() > 0) {<br><br> out.write("<ul>\n");<br><br> Iterator navItem = navList.iterator();<br> CmsJspNavElement nav;<br> while (navItem.hasNext()) {<br> nav = (CmsJspNavElement) navItem.next();<br>
String navText = nav.getNavText();<br> String navPath = nav.getResourceName();<br> if (nav.isFolderLink()) {<br> out.write("<li><a href=\"" + navPath + "\"><b>" + navText + <br>"</b></a></li>\n");<br> buildSiteMap(cms, navPath, out); // recurse...<br> } else {<br> out.write("<li><a href=\"" + navPath + "\">" + navText + <br>"</a></li>\n");<br> }<br> }<br><br> out.write("</ul>\n");<br> }<br>}<br>%><BR><%<br><br>CmsJspActionElement cms = new CmsJspActionElement(pageContext, request, <br>response);<br>buildSiteMap(cms, "/", out);<br><br>%><BR><BR>5. Switch to the "/sites/default/" site and create a new page - you can <BR>now select "My template" as the template for the page. And then you're <BR>ready to rock...<BR><BR>regards<BR>Claus<BR><BR>Holger Schick wrote:<BR>> Hello,<BR>> well i did my first template. overall i took me hours - but only to find errors like editing the following attributes wrong.<BR>> I
used a wrong order= and id= attribute value. I couldn't find a documentation where i can find id- and order numbers which i can use. <BR>> <BR>> <NEWRESOURCE page="structurecontent" order="777" uri="newresource_xmlcontent.jsp?newresourcetype=seminar" /><BR>> <TYPE class=org.opencms.file.types.CmsResourceTypeXmlContent id=79 name="seminar"><BR>> <BR>> Another Error was because of all the copy and paste a pasted a already used uuid. The Exception was not while importing an invalid id or something. I retreived a marshalling exception because the module used the wrong xsd. I found the reason in the import module protocol. There was a file name which i didn't wanted to import.<BR>> <BR>> What are your experiences with open cms? Are this typical newbies errors or do you have also such errors even if you are working already with open cms?<BR>> Or is the only reason that i couldn't find a good documentation and somewhere is one?<BR>> Is there anywhere
more documentation available for the manifest.xml or really good community web sites? <BR>> Is there also a build tool for the manifest available something like a ant script?<BR>> <BR>> <BR>> thanks <BR>> <BR>> Holger<BR>> _______________________________________________________________<BR>> SMS schreiben mit WEB.DE FreeMail - einfach, schnell und<BR>> kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192<BR>> <BR>> <BR>> _______________________________________________<BR>> This mail is sent to you from the opencms-dev mailing list<BR>> To change your list options, or to unsubscribe from the list, please visit<BR>> http://lists.opencms.org/mailman/listinfo/opencms-dev<BR>> <BR><BR>-- <BR>Claus Priisholm, CodeDroids ApS<BR>Phone: +45 48 22 46 46<BR>cpr (you know what) codedroids.com - http://www.codedroids.com<BR>cpr (you know what) interlet.dk - http://www.interlet.dk<BR>--<BR>Javadocs and other OpenCms stuff:
<BR>http://www.codedroids.com/community/opencms<BR><BR>_______________________________________________<BR>This mail is sent to you from the opencms-dev mailing list<BR>To change your list options, or to unsubscribe from the list, please visit<BR>http://lists.opencms.org/mailman/listinfo/opencms-dev<BR></BLOCKQUOTE><BR><p>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam? Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com