The content type CMS_TEASER is very powerful content type in CONTENIDO.
CMS_TEASER provides creation and configuration of teasers in CONTENIDO backend and output in frontend of the page.
To use CMS_TEASER put the code below in your output modul section.
The name CMS_TEASER specifies which content type should be used and [1] is the index of headline. The index must be integer value.
If you are using more then one CMS_TEASER per article, you have to change/increment index of the next CMS_TEASER. |
echo "CMS_TEASER[1]"; or echo "CMS_TEASER[100]"; |
The configuration of CMS_TEASER is very powerful, that allows you individualize your teaser.
To configure teaser click on the blue list symbol(see screenshot below). Configuration is splitted in three tabs.
In the first tab Automatic you can set:
After configuration click on green check icon, that will save your configuration. Or click on the red cross to cancel.
In the second tab Manual you can set:
After selection click on blue plus icon, this icon will put your selection each time in included list.
With red trash icon you can also delete articles from included list.
After configuration click on green check icon, that will save your configuration. Or click on the red cross to cancel.
In the third tab Settings you can set teaser related settings. Which are content visualisation, pictures and content types.
Content visualisation:
Pictures:
Content types:
This setting is very important for the teaser. Teaser loads article content from defined content types in this setting.
You have to define here the content type and index, which you use in your articles.
If you dont know which content types are in usage, go to article which you want to teaser, and click on raw data tab(see screenshot below).
Teaser templates are high customisable. To view teaser templates go to style -> html.
The name of teaser templates begins with cms_teaser and contains html markup with cTemplate placeholdern, which are filled by content type(see example below).
! At Version 4.10 the first <h2>{TITLE}</h2> will be changed to <h2>{TEASER_TITLE}</h2>
<div class="column_quarter text"> <h2>{TITLE}</h2> <!-- BEGIN:BLOCK --> <div class="col"> <h3>{TITLE}</h3> <span class="date">{PUBLISHED}</span> <p>{TEXT}</p> <a href="{ART_URL}" class="more" title="{TITLE}">{MORE} »</a> </div> <!-- END:BLOCK --> <div class="clear"></div> </div> |
The code between <!-- BEGIN:BLOCK --> and <!-- END:BLOCK --> will be executed more then once. It depends how much teaser entries you have.
Possible placeholder which you can use are:
{TITLE} Version 4.9.12 (Outside the BLOCK statement, e.g. for "News")
{TEASER_TITLE} Version 4.10
{TITLE} (inside the BLOCK statement, represents the respective article-headline)
{IMAGE}
{IMAGE_SRC}
{IMAGE_MEDIANAME} Version 4.10
{TEXT}
{ART_URL}
{PUBLISHED}
{PUBLISHED_MANUAL}
{PUBLISHED_COMBINED}
The default templates are:
- Slider style (cms_teaser_slider.html)
- Image style (cms_teaser_image.html)
- Text style (cms_teaser_text.html)
- Blog style (cms_teaser_blog.html)
Your own image template could be named:
4collumn (cms_teaser_image_4col.html)
Thats it.
List all methods for CMS_TEASER at our API documentation.
Function name | Description |
---|---|
generateViewCode() | Generates the code which should be shown if this content type is shown in the frontend. |
getConfiguredArticles() | Function returns idarts of selected articles as array. |
generateTeaserCode() | Function is called in edit- and viewmode in order to generate teasercode for output. Returns string of select box (if teaser template exists) or array of articles. |
generateEditCode() | Generates the code which should be shown if this content type is edited. |