Teaser_XH 1.2.1

for CMSimple_XH 1.5/1.6/1.7, CMSimple 4
with online editors: CKeditor, Tinymce or Codeeditor


Teaser_XH puts several divs on a page, each of which can be filled with content in the plugin backend. These divs can be assigned an internal or external link in order to serve as teasers for other pages.

Via css the teasers can be arranged in rows or one under the other. Their number and order can be changed in the plugin backend. Mouse over effects are possible. Different groups of teasers can get different css-styling which will be shown also in the backend. For backend editing a different site template can be assigned as well to a specific group of teasers.

New in Version 1.2

New in 1.1
Copy button for teasers
New in 1.0:
To edit a teaser click on the teaser preview in admin mode.

Usage

To put teasers on a page enter the code {{{PLUGIN:teaser();}}}. This will present the default teaser file. If you need a specific teaser group, use {{{PLUGIN:teaser('NAME_OF_YOUR_TEASER_FILE');}}}

The plugin menu will display the online editor with the teaser you edited last followed by a preview of the whole teaser group. The height of the editor window can be set in plugin config.

Teaser files always contain a group of teasers in ready HTML code. Thus the plugin doesn't require a lot of computing by the CMS.

For backend editing the plugin extracts a single teaser from the HTML code of the whole teaser group. Select a teaser for editing by clicking on the preview below the editor.

The standard teaser group is teaser_XX.txt [XX = language code of your site]. Choosing in the option list either standard file or teaser_XX.txt is the same. Via the option list you can create, delete or copy teaser group files. Teaser_XH comes with several examples. Names for new teaser group files will automatically get the ending .txt.

Every teaser group has its css style class, which can be selected from an option menu.

Links and Background

Single Teasers can get a global Link and an individual background. The button for displaying the background dialog is shown only, when an image path is specified in plugin config. Preset is plugins/teaser/images/. Repetition, horizontal and vertical adjustment and background color can be added manually next to the image option list.

The editor tries to mimic the style and background of the template. However in complicated templates it doesn't work. The preview however shows the real result.

Note for multilanguage sites: Internal links and background images set in secondary languages usually do work only in secondary languages and not in the main language (and vice versa), as the image path for secondary languages differs from the image path in the main language. Edit teasers for secondary languages from the secondary language, otherwise links, images and background images may not be found.

Editing Css Styles

Teaser_XH creates a basic <div class="teaser STYLE-CLASS-NAME"> wrapper around all teasers of a group. The individual teasers again are surrounded by another <div>. Styling is done as usual via the plugin css.

Definitions of the different available Teaser style classes always start with /*startSTYLE-CLASS-NAME*/ and end with /*endSTYLE-CLASS-NAME*/. Every css-definition belonging to such a class must begin with div.teaser.STYLE-CLASS-NAME div or .teaser.STYLE-CLASS-NAME div.

Note: Browsers cache css-files (to load pages faster), therefore changes in a css file may not be displayed on normal pages by your browser because the css is not read again. Reloading the page usually makes the browser reload the css, and your changes will become visible.

Hovering Effects in Teasers With Global Links

The plugin writes the global link at the beginning of the teaser content in a span area. This is used for hovering effects, e.g. div.teaser.STYLENAME div:hover a ~ h4 {...} produces a hovering effect on h4 paragraphs, when a global link is present. For effects on borders and background, use div.teaser.STYLENAME:hover span.teaser {...}

Page Templates

If you use different templates on your site, you may want to use teaser on a page with a special template. This template can also be used while editing the teasers.

In plugin config you can set under template change for specific teaserfiles the template as well as morepagedata settings for every teaser group.

The entry mode is as follows:
First enter the teaserfilename (don't forget that these names always end in .txt, the name of the standard teaser file being teaser_LANGUAGECODE.txt), followed by a semicolon, and the name of the wanted template, and, if morepagedata settings are needed, semicolon and morepagedata variables. If you need to enter data for more teaser files, enter as separator | and proceed as before.

For morepagedata settings, enter the relevant morepagedata variables (without $) followed by =, their value and ;. Don't use '' or = in the value part, as these are reserved signs.

Example:

teaser_en.txt;;wide=1;|test.txt;venice
Here are two parts divided by "|". The first part means: the standard teaser file uses the standard template (= because there is no entry between ;;), however a morepagedata template change is called, namely the variable $wide should be switched on (i.e. the textarea should be wider than normal). Second part means: the teasers of the file test.txt should be presented in the teaser backend with the page template "venice".

Miscellaneous

Saving Location of Teaser Files

Three saving locations are possible

Writing permissions

Depending on your server configuration you may have to give writing permissions to the data folder and its files, as well as to languages, css and config.