Templates

Describes how to create/modify templates in ImCMS

In this article:

Create new template

  1. Create new file with jsp extension in WEB-INF/templates directory.

  2. Add following code to created file

    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title>Template</title>
        <meta charset="utf-8"/>
    </head>
    <body>
        Hello World with New Template!
    </body>
    </html>
    
  3. Run application using Tomcat (make a package if you are using maven, of package only this new file if you are using your IDE).

  4. Login into ImCMS as Admin. Check Logging in section.

  5. Open Page info on Admin Panel (see Admin Panel guide), choose Appearance tab and select your file in Template list.

  6. Save changes by clicking “OK” button

Modify template

Modify your templates in /WEB-INF/templates directory until you’re done. Keep your templates as simple as possible. Try to use one template per document, move common used parts into separated JSP files with their including. Logic can be moved to functions in TLDs. Use JSTL tags over scriptlets.

Summary

Now you know how to create, modify and use templates.