O'Reilly logo

Managing and Customizing OpenCms 6 by Matt Butcher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Including the Scriptlet in the Template

Now that we have a navigation scriptlet stored in the elements directory, how can use it in the template? A simple addition to our template will add navigation. Here is the template file, with the new addition highlighted:

<%@ page session="false" %>
<%@ taglib prefix="cms"
uri="http://www.opencms.org/taglib/cms" %>
<!DOCTYPE html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><cms:property name="Title" escapeHtml="true"/></title>
<link type="text/css" rel="stylesheet"
href="<cms:link>/system/modules/tv.alephnull.modules.templates/resources/main.css</cms:link>"/>
<cms:editable/>
</head>
<body>
<h1><cms:property name="Title" escapeHtml="true"/></h1>

<div name="menu"

style="float:left;border:1px ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required