This website can use cookies to improve the user experience

This website can use cookies to improve the user experience and to provide certain services and functions to users. Cookies contain small amounts of information (such as login information and user preferences) and will be stored on your device.

Enable All Cookies Privacy Policy

Working with Content Types

Creating you own content types

You can create your very own content types by creating new or altering existing content type XML files. The content types are located at the /data/ctypes directory.

The files starting with pXXXX_typename.xml are for publish and the files with rXXXX_typename.xml are for the response module.

Publish Example

Here as an example the content type for pages (p0000_pages_xml):
<?xml version="1.0" encoding="utf-8"?>
<contenttype>
    <info>
        <name>Pages</name>
        <about>A content type to handle pages</about>
    </info>
    <fields>
        <field>
            <name>title</name>
            <text>Title</text>
            <description></description>
            <type>text</type>
            <required>1</required>
            <error>The title field is blank. Please fill in a title.</error>
        </field>
        <field>
            <name>date</name>
            <text>Publish Date</text>
            <description></description>
            <type>datetime</type>
            <required>1</required>
            <error>{#content_date_blank#}</error>
        </field>
        <field>
            <name>page</name>
            <text>Page</text>
            <description></description>
            <type>textarea_large</type>
            <required>1</required>
            <error>The page text field is blank. Please fill in some content.</error>
        </field>
    </fields>
    <links>
        <main>pages</main>
        <details>page</details>
    </links>
</contenttype>

The content type XML file started with:

<?xml version="1.0" encoding="utf-8"?>
<contenttype>

The info fields are the content type name and description, in this case Pages and A content type to handle pages as description:

    <info>
        <name>Pages</name>
        <about>A content type to handle pages</about>
    </info>

Next we need to specify the used fields:

    <fields>

Our first field is the Title:

        <field>
            <name>title</name>
            <text>Title</text>
            <description></description>
            <type>text</type>
            <required>1</required>
            <error>The title field is blank. Please fill in a title.</error>
        </field>

Name is the fields name used in the database. Text is the text that is show up in the content editor while Description is an optional description. With the Type option you can set the field type, in this case text for a text field. The Required option turns this field into a required field. If this field is empty, the user will get the error message specified in the Error field. Next field is for the date:

        <field>
            <name>date</name>
            <text>Publish Date</text>
            <description></description>
            <type>datetime</type>
            <required>1</required>
            <error>{#content_date_blank#}</error>
        </field>

This is almost identically expect for the type, which is datetime for a time stamp. The last field is page:

        <field>
            <name>page</name>
            <text>Page</text>
            <description></description>
            <type>textarea_large</type>
            <required>1</required>
            <error>The page text field is blank. Please fill in some content.</error>
        </field>

Here is the type set to textarea_large for a large text area. Finally, we are closing the fields:

    </fields>

Now we need to set the links:

    <links>
        <main>pages</main>
        <details>page</details>
    </links>
In this case, we use pages as main link. This means content with this content type are accessible over www.example.com/pages/. The details option is set to pages, which will be used for the pages itself. For example, www.example.com/pages/some-page.html. Finally, we close the content type with:
</contenttype>

Next are the templates. Publish content types are using 4 templates. This first template in this example is pages. The template name of the first template is always the name you set under links/main.

          <!-- Template: pages -->
          <article class="site-post site-post-next">
            <header>
              <h2 class="site-post-title">{%icon%}<a href="{%website_url%}/page/{%seo%}/"{%website_target%}>{%title%}</a></h2>
            </header>
            {%teaser_image%}
            {%page%}
          </article>

The first template (in this case pages) is the template the is showing either the front page or the content type pages (e.g. www.example.com/pages/). Next with the template for the headlines, pages_headline:

          <!-- Template: pages_headline -->
          <div class="site-post site-post-headline{%alt%}">           
            {%icon%}<a href="{%website_url%}/page/{%seo%}/"{%website_target%}>{%title%}</a>            
          </div>

This template is will be used for the headline view. Next we have the template used in the details page: pages_page. The name based on both links fields: pages (main) _ page (details).

          <!-- Template: pages_page -->
          <article itemscope itemtype="https://schema.org/WebPage">
            <header>
              <h2 class="site-post-title">{%icon%}<a href="{%website_url%}/page/{%seo%}/"><span itemprop="name">{%title%}</span></a></h2>
            </header>
            {%teaser_image%}
            <article itemprop="text">
                {%page%}
            </article>
            {%share_buttons%}
          </article>

and there is pages_page_response. The templates with _response are usual an alternative of the details template featuring the comments and ratings tab. However, in this case the template is identically with the pages_page. This last template is pages_page_print, which is a printer friendly version of pages_page:

     <!-- Template: pages_page_print -->
    <h2>{%title%}</h2>            
    {%page%}

    <hr />
    Printed from: <a href="{%website_url%}/page/{%seo%}/">{%website_url%}/page/{%seo%}/</a> 


Publish Fields

The following fields are supported by the Contentteller publish module:

text - for text fields

        <field>
            <name>textfield</name>
            <text>Example Text Field</text>
            <description>This is an example text field</description>
            <type>text</type>
            <required>1</required>
            <error>The example text field is blank.</error>
        </field>

description_text - for description text fields

        <field>
            <name>descriptiontext</name>
            <text>Description Text</text>
            <description>This is a description text field</description>
            <type>description_text</type>
            <required>1</required>
            <error>The example description text field is blank.</error>
        </field>

description_textarea_mini - for a description text area with 5 rows

        <field>
            <name>descriptionmini</name>
            <text>Description Mini</text>
            <description>This is an example description text area mini field</description>
            <type>description_textarea_mini</type>
            <required>1</required>
            <error>The example text area mini field is blank.</error>
        </field>

description_textarea_small - for a description text area with 10 rows

        <field>
            <name>descriptionsmall</name>
            <text>Description Small</text>
            <description>This is an example description text area small field</description>
            <type>description_textarea_small</type>
            <required>1</required>
            <error>The example text area small field is blank.</error>
        </field>

description_textarea - for a regular description text area with 20 rows

        <field>
            <name>descriptiontextarea</name>
            <text>Description Text Area</text>
            <description>This is an example description text area field</description>
            <type>description_textarea</type>
            <required>1</required>
            <error>The example text area field is blank.</error>
        </field>

description_textarea_large - for a description  text area with 30 rows

        <field>
            <name>descriptionlarge</name>
            <text>Description Large</text>
            <description>This is an example description text area large field</description>
            <type>description_textarea_large</type>
            <required>1</required>
            <error>The example text area large field is blank.</error>
        </field>

description_eula - for the EULA field to show the end user license agreement for a download

        <field>
            <name>eula</name>
            <text>EULA Field</text>
            <description>This is an example EULA field</description>
            <type>description_eula</type>
            <required>0</required>
            <error></error>
        </field>

datetime - for date and time fields

        <field>
            <name>datetime</name>
            <text>Example Date&Time Field</text>
            <description>This is an example date&time field</description>
            <type>datetime</type>
            <required>1</required>
            <error>The date&time field is blank.</error>
        </field>

textarea_mini - for a text area with 5 rows

        <field>
            <name>textareamini</name>
            <text>Example Text Area Mini</text>
            <description>This is an example text area mini</description>
            <type>textarea_mini</type>
            <required>1</required>
            <error>The example text area mini field is blank.</error>
        </field>

textarea_small - for a text area with 10 rows

        <field>
            <name>textareasmall</name>
            <text>Example Text Area Small</text>
            <description>This is an example text area small</description>
            <type>textarea_small</type>
            <required>1</required>
            <error>The example text area small field is blank.</error>
        </field>

textarea - for a text area with 20 rows

        <field>
            <name>textarea</name>
            <text>Example Text Area</text>
            <description>This is an example text area</description>
            <type>textarea</type>
            <required>1</required>
            <error>The example text area field is blank.</error>
        </field>

textarea_large - for a text area with 30 rows

        <field>
            <name>textarealarge</name>
            <text>Example Text Area Large Field</text>
            <description>This is an example text area large field</description>
            <type>textarea_large</type>
            <required>1</required>
            <error>The example text area large field is blank.</error>
        </field>

textarea_multipage - for a text area with support for multiple pages for articles and reviews

        <field>
            <name>multipage</name>
            <text>Example Text Area Multipage</text>
            <description>This is an example text area multipage</description>
            <type>textarea_multipage</type>
            <required>1</required>
            <error>The example text area multipage field is blank.</error>
        </field>

textarea_howto_mini - for a howto text area with 5 rows

        <field>
            <name>howtomini</name>
            <text>Example Howto Mini Field</text>
            <description>This is an example howto mini field</description>
            <type>textarea_howto_mini</type>
            <required>1</required>
            <error>The example howto mini field is blank.</error>
        </field>

textarea_howto_small - for a howto text area with 10 rows

        <field>
            <name>howtosmall</name>
            <text>Example Howto Small Field</text>
            <description>This is an example howto small field</description>
            <type>textarea_howto_small</type>
            <required>1</required>
            <error>The example howto small field is blank.</error>
        </field>

textarea_howto - for a howto text area with 20 rows

        <field>
            <name>howtotextarea</name>
            <text>Example Howto Field</text>
            <description>This is an example howto field</description>
            <type>textarea_howto</type>
            <required>1</required>
            <error>The example howto field is blank.</error>
        </field>

textarea_howto_large - for a howto text area with 30 rows

        <field>
            <name>howtolarge</name>
            <text>Example Howto Large Field</text>
            <description>This is an example howto large field</description>
            <type>textarea_howto_large</type>
            <required>1</required>
            <error>The example howto large field is blank.</error>
        </field>

textarea_howto_multipage - for a howto text area with support for multiple pages

        <field>
            <name>textfield</name>
            <text>Example Text Field</text>
            <description>This is an example text field</description>
            <type>text</type>
            <required>1</required>
            <error>The example text field is blank.</error>
        </field>

download - for downloads

        <field>
            <name>download</name>
            <text>Example Download Field</text>
            <description>This is an example download field</description>
            <type>download</type>
            <required>1</required>
            <error>The download field is blank.</error>
        </field>

link - for web links

        <field>
            <name>weblink</name>
            <text>Example Weblink</text>
            <description>This is an example weblink field</description>
            <type>link</type>
            <required>1</required>
            <error>The example weblink field is blank.</error>
        </field>

dropdown - for dropdown menus

        <field>
            <name>dropdown,Option 1,Option 2,Option 3,Option 4</name>
            <text>Example Dropdown Menu</text>
            <description>This is an example dropdown menu</description>
            <type>dropdown</type>
            <required>0</required>
            <error></error>
        </field>

checkbox - for checkboxes

        <field>
            <name>checkbox,Option 1,Option 2,Option 3,Option 4</name>
            <text>Example Checkbox Options</text>
            <description>This are example checkbox options</description>
            <type>checkbox</type>
            <required>0</required>
            <error></error>
        </field>