OpenWGA 7.10 - WebTML reference

WebTML tags

<tml:createpage>

Description :
Displays a  control to create a new document, if you are in the WGA Content Manager.

By using this tag the designer is able to define certain clickable spots within the website layout which offer authors a shortcut to create new documents of a predefined content type and position. In this way new documents are normally created below the current document in context. If the created document should be a root document instead, you can choose the target area by using the attribute area.The content type can be preset by the attribute contenttype.

This tag has two operation modes:

Basic mode (without tag content)

This will let the tag just display a create button if the user is editing the current document and hide it in all other situations.

Extended mode with tag content containing <tml:createbutton>

You should choose this mode if there is more to display around the create button to keep the page design consistent. For example if you need some HTML container tag around it so it displays like all other links in a navigator. Use attribute container to specify the container tag, which will be rendered by <tml:createpage> automatically. Then put anything in the tag contents of <tml:createpage> that should be rendered inside this container tag. At an appropriate position put a <tml:createbutton> tag where the actual button to create the page should be placed.

Derived from: Attributes:
show inherited attributes ...
Name Value(s) Purpose
area website-area-name Specifies the name of the area in which a new document should be created as root document
container tag-name Specifies a HTML container tag to render which is automatically displayed and hidden with the create button
contenttype documenttype content type of the created document
cssclass css-class Specifies a CSS class for the container tag
cssstyle css-styles Specifies CSS style definitions for the container tag
message message-text Determines the title of the create button

Details:
The advantage of  the <tml:createpage>-Button over the default-creation-functionality of the WGA Content Managers is the user-defined positioning functionality and the presetting of  creation date.

The designer can position the creation-functionality for special content types on a website where the authors would expect them. Usually it is near navigators or collections which display documents of this type. So the designer could offer a button to create new documents e.g. from type "news", below a collection of documents from this type.

This tag checks the permission of the current author before displaying the button. If the author is not allowed to use the button at the chosen content type and the chosen position, the button will not be displayed.
Examples:
In this example of the basic mode we display a news collection with a navigator. Directly above is the button to create new news-documents. The necessary informations like position and content type are already preset.

<div id="news">
            <tml:createpage contenttype="news" context="name:news" message="{label('new-pressrelease')}"/>
            <tml:children context="name:news" sortorder="descending" sortexpression="MODIFIED" pagesize="30">
                  <h1><a href="<tml:url/>"><tml:item name="headline"/></a></h1>
                  <p>
                      <tml:item name="body"/>
                  </p>
              </tml:children>
</div>

Here is an example of the extended mode. We have a navigator putting out links in <li> tags. When the create button should be shown we want to display it in yet another <li> tag, so that it shows up like an additional link of the navigator. We let <tml:createbutton> display the <li> as container tag and specify a <tml:createbutton> inside it. So, if the create button should show it is shown inside that <li> tag along with the other list items. If not the whole <li> tag and its contents will be hidden.

<ul>


  <tml:navigator type="children">

    <li>

      <tml:link/>

    </li>

  </tml:navigator>


  <tml:createpage container="li"> 

    <tml:createbutton message="Neue Seite"/>

  </tml:createpage>


</ul>