wiki:Tutorial/CMS_Intro

Implement the Cms - a first step

Introduction

I will make this as easy as possible. The only thing you need in order for this howto to work is to have corinis set up with the war/zip file (or using the installer). This will not work in a multi-app environment (you need to add app="yourappname")!

create a new webpage (see something quick)

Use your favorite editor and create a file named index.jsp in your webroot (where the install.jsp is) and copy paste the following code:

<%@ taglib uri="/corinisTags" prefix="corinis" %>
<corinis:cms/>

I will explain everything later on in more detail. This is just to get things rolling. Next login to corinis's administration page, click on and then on . Create a new template File->New give it the name content and the filename content.xhtml. Click Create.

In the edit column, click on content.xhtml to edit it, then put the following data inside:

<html>
  <body>
    <h1><corinis-field type="edit" name="header"/></h1>
    <h2><corinis-field type="richedit" name="abstract"/></h2>
    <corinis-repeatable name="content">
      <corinis-field type="image" name="image" style="float:left"/>
      <corinis-field type="richedit" name="text"/>
    </corinis-repeatable>
  </body>
</html>

Save it and click on again. Now assign the new template to the root document (/) you might have to click on .. once to find it.

And edit the document...

Next you put some content in the page and save the whole thing (Make sure the little red images turns to green, which means your work is saved). Close the document and put it in the life system (press first the QM button - you dont need to send a message, then the light next to the document will turn red. To send it life press the "life" button. If the light is green you are ready to go on - these steps are required every time you cahgne something. In later versions we are planning to change this behaviour, so you can choose wheter you want everything life right on save, or a split system like it is right now). If you open your webbrowser to  http://localhost:8080/index.jsp (change according to your installation) you will se the text you just saved.

You got a cms up and running!!'''

What's going on?

Ok now for the descriptions.

the index.jsp - line by line

<%@ taglib uri="/corinisTags" prefix="corinis" %>

This tells tomcat, that you are planning to use corinis functions. Make sure this is on top of every page, otherwise the corinis functions will not be available.

<corinis:cms/>

This is how you include the cms. At this point of the page, the cms content will be inserted.

If you want you can put html around the <corinis:cms/> tag, like some layout.

The cms and the template

We now know how the cms is being executed through jsp pages. I will not describe all lines in the template becuase you can read about that in Templates.

The document / (id: 0) is the root document. It is being used when you do not tell the cms to fetch anything else. By assigning a template to it and saving some content, the getDocument function combines these two parts and out comes a webpage.

Depending on your personal style you can put the whole html code (including <html> and <body> tags) in the template or just the pure content part and put the border (navigation, everything that doesnt have anything to do with the content) in the jsp. If you do put everything except the content in the jsp the whole system will run a little faster and the editing will also be nicer, since you can concentrage on the content alone. On the other hand by putting everything in the template you get a better feeling of how the page will look like while editing.

I also left out all information about rights, navigation and much more. This was only to give a first view of what's going on. To find out more read Implement a Cms from scratch

It is also a good idea to tackle Implementation now to get a first glance on how to include basic modules. This page also explains a lot of xsl, which you will need in "Implement a Cms from scratch" for the cms navigation.

Attachments