SAPID Encyclopedia  
Sapid   SAPID-Club (English, Russian, Portuguese forums) SAPID-Workshop (Project and developer charts) SAPID-Wiki (SAPID Live Encyclopedia) SAPID-Farm (The best place for a SAPID-based project)
Download
eXTReMe Tracker
HomeDocumentationSite CreationTemplate Creation

Template Creation

A template defines the look of a document. Please go to “Templates” interface to create a new template. There, you can create a new template as well as change or delete and existing one. You can also add and edit auxiliary files such as CSS-files, java scripts in this interface. Let's try to create a new template. Press “Create a new template” button and go to template adding interface. First, please enter the name of the new template. You will then need to insert the presentation code of the template.

For example,

<html>
     <body> 
          <h1>Title</h1> 
          Text 
     </body>
</html>

However you need to specify which content blocks can be edited in the administrative mode (”Title” and “Text”) . Select “Title” word and press the farthest left button under the code editing field. You should specify the name of the content query pointer (e.g. “title”) and choose the type of a pointer (e.g. “String content query”). The “Title” word will be replaced by the content query pointer. Than we can select the “Text” word and repeat actions. Now we specify the name of the pointer “body” and “Visual editor” type. As a result we will get the following template:

<html> 
    <body> 
        <h1><sapi:apply name=”qc.title.value” type=”string” /></h1> 
        <sapi:apply name=”qc.body.value” type=”publication” /> 
    </body>
</html>

After saving the changes in the template, we will see the general template list of the system. These templates can be assigned to documents in the structure management interface.

While creating and editing the templates you can set the location for editable content and specify the location of content blocks, which are common for a group of documents (SDC). You can also include a system module (DDC) in a template, insert a system variable or other construction, which conform with the XML Sapiens specification requirements (www.xmlsapiens.org).

Please see an interactive help course at http://sapid.sf.net/download/screate/

Syntax of XML Sapiens Objects Pointers in Document Templates

General construction for any object pointer in SAPID looks as follows:

<sapi:apply name="object.value" />

Thus, the pointer of system variable data can look like this:

<sapi:apply name="variable1.value" />

We define the variable, the value of which we expect to see as a result of the document presentation. The name of the variable is variable1.

The pointer of a query container looks like this:

<sapi:apply name="qc.body.value" type="string" />

Notice

In the current version of SAPID you may use only defined query containers. Their type and the query shape in administrative mode is set to the auxiliary attribute ‘type'. We can choose from the following attribute types: attribute value ‘text' for string query, ‘publication' for visual editor, ‘image', ‘file' and ‘checkbox'.

For example:

<sapi:apply name="qc.body.value" type="publication" />

Including the System Code of CMS Language

In special cases you need to turn to the CMS programming language code directly. XML Sapiens specification and SAPID support system language includes the following syntax:

<?EXTERNAL a_code_of_the_system_language ?>

or

<?SYSTEM a_code_of_the_system_language ?>

Since the SAPID uses a PHP programming language, the code inside the construction is PHP code.

Notice

Including the system language isn't recommended since it hinders portability of functional solutions.



User Contributed Notes

January 01, 1970 00:00
Add a note

Your email address/name
Your notes
Red Graphic Systems Sponsored