EXT: Content Teaser - JIZ

jizmuenchen

EXT: Content Teaser - JIZ

EXT: Content Teaser

Extension Key: wm_contentteaser

Copyright 2000-2008, Dipl.-Ing. Manfred Widmann,

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.com

Table of Contents

Extension Content Teaser...................................................................................................... 2

Quick Glimpse .....................................................................................................................................................................2

Installation............................................................................................................................................................................2

Prerequisites....................................................................................................................................................................2

Process............................................................................................................................................................................2

Usage....................................................................................................................................................................................2

Record Type Pagecontent ...............................................................................................................................................2

Known Problems / Ideas.....................................................................................................................................................4

Changelog............................................................................................................................................................................4

Plugin pi1: Content Teaser..................................................................................................... 5

Result....................................................................................................................................................................................5

Screenshots.....................................................................................................................................................................5

Description.......................................................................................................................................................................5

Installation............................................................................................................................................................................5

Configuration / Adaption.....................................................................................................................................................5

TypoScript Plugin Object .................................................................................................................................................6

HTML-Template ...............................................................................................................................................................6

CSS..................................................................................................................................................................................7

EXT: Content Teaser - 1


Quick Glimpse

This extension delivers following features:

Extension Content Teaser

• Adds some fields to every tt_content record to make a teaser for this very content possible.

• Properties are teaser on/off, teaser start and end date, teaser headline, a pic, and even a full rte text.

• Supports lightboxing.

• Supports alternate layouts.

• Highly adoptable by the use of HTML templates and CSS

Installation

To install this extension please be aware of the following:

Prerequisites

TYPO3 Version

The extension was developed under TYPO3 4.0.x; any version higher should be OK. You can try also to install it in an earlier

version which is likely to succeed though it's experimental.

Other Extensions

none

Process

1. Check whether you run the necessary version of TYPO3.

2. Invoke the Extension Manager (EM) (Tools > Ext Manager)

3. Choose menu option “Loaded Extensions”

4. Check whether all other required extensions (see above) are installed.

5. Choose menu option “Import Extension”

6. Either locate this extension (wm_contentteaser) via the “Look Up” dialog in TYPO3 Extension Repository (TER) or

upload the extension file directly from your hard disc (which of course has been downloaded to it from TER first).

The later is often the only working way because only reviewed extensions can be downloaded directly from TER by

EM.

7. Press “Upload extension file” which decompresses the *.t3x file and copies it onto your TYPO3 installation

(../typo3conf/ext/wm_contentteaser).

8. Press “Install extension” which will activate it by means of creating relational tables, adding BE screens, adding

Static includes, etc...

9. Accept changes by pressing “Update”

10. Congratulation, you're through with it for the moment. A few steps still remain to install each plugin of this extension

you want to use. These steps are described in the chapters about the plugins.

Usage

Editors use this extension by entering information in form of datasets with the help of the following screens:

Record Type Pagecontent

EXT: Content Teaser - 2


Here you find a description of the fields to enter:

Field: Data type: Description:

Tease Me Boolean If unchecked, no content teaser will be rendered.

Teaser Start Date A content teaser is displayed from Teaser Start until Teaser Stop Date.

Teaser Stop Date A content teaser is displayed from Teaser Start until Teaser Stop Date.

Teaser Headline String The heading of the teaser.

Teaser Image Image Upload a picture with the “Browse” button. It makes nearly no sense to take one bigger than

800 x 600 pixels or so.

Teaser Content Text Full RTE text …

EXT: Content Teaser - 3


Known Problems / Ideas

The following is on “the list”:

None at the moment.

Changelog

Version: Date: Description:

1.2.0 2009M01 • All strings are localized now.

• Value assignment to template markers is done with function htmlspecialchars().

• sql_free_result() is consequently used now.

• String quotation is done with single quotation mark now.

• In SQL queries intval() an fullQuteStr() is used consequently.

• Newly created Database Indices shall speed up the extension.

• Alternating HTML Templates possible.

1.1.0 2008M01 • The teaser now can contain a pic and a RTEable textfield.

• pi1: $this->cObj->enableFields( "" ) used when accessing tables

• New improved structure of extension

• Lightbox display optionally anabled

• Lot of small changes in TCA in the area of input validation.

1.0.0 ??? • Initial version

EXT: Content Teaser - 4


Result

Screenshots

Plugin pi1: Content Teaser

Description

This extension adds a flag, a pic, etc... to tt_content so that one is able to identify certain records. These records are selected

by the frontend plugin and rendered anywhere on your site with the well-known template / marker / subpart mechanism.

Installation

To install this special plugin you have to do a few steps more (after the installation of the extension itself (see above)):

1. Select the root TS Template by choosing Web>Template and clicking on “root”

2. Press “Click here to edit full record”

3. Move down to section “Include Static from extensions)

4. Locate “Content Teaser (wm_contentteaser)” and click it

5. Save the record.

6. Press “Clear All Cache”.

7. Ok, done!

Configuration / Adaption

With the installation of the extension and the installation of the plugin it should be possible to run the plugin with default

configuration. Thats more or less the style I use it on our website www.radclubwels.at. I'm pretty sure you will like to change

the behavior of the plugin to better fit onto your site.

There are three levels of options you have (which are described in detail later):

Parametrize Plugin: Every Plugin needs some parameters which are passed from TYPO3 (namely a TS Template)

to the plugin via a TS plugin object. You find a default setup – which has to be copied into a TS template's setup

section – in the ../typo3conf/ext/wm_contentteaser/pi1/tsTemplate directory. Feel free to change the values but don't

change the properties as the plugin will not recognize it.

Adopt CSS: By changing CSS styles you can change the look up to a certain point. Maybe this is enough for your

needs. It's recommended that you store this in a subdirectory to ../fileadmin so your work isn't lost when upgrading

to a newer version of the extension. The default stylesheet is loacated in the

../typo3conf/ext/wm_contentteaser/pi1/htmlTemplate directory. Don't forget to include the stylesheet so your browser

knows where to locate your styles. This can be done via a page.includeCSS property (see later).

Adopt HTML template: You can create your own result by changing the given HTML template (or writing a

EXT: Content Teaser - 5


completely new one). You only have to keep in mind, that the plugin knows a certain set of subparts and markers

which you can use – that's all. It's recommended that you store this in a subdirectory to ../fileadmin so your work

isn't lost when upgrading to a newer version of the extension. The default template is loacated in the

../typo3conf/ext/wm_contentteaser/pi1/htmlTemplate directory. Don't forget to mention the path to your newly

created template in the TypoScript object so the plugin knows where to read it from.

TypoScript Plugin Object

This is an example how the setup of the TS template may look like:

plugin.tx__pi1 {

# Location of template file

template = fileadmin/template/wm_contentteaser/template.html

# other parms /see below)

}

This code can be placed in a TS template's setup section located somewhere “above” in the page tree. If not, the plugin uses

the default values provided either in the static include or in the plugin itself.

You can use the following TS Plugin Object to parametrize the plugin – i.e. to parametrize how the plugin will replace the

markers in the HTML template (see later).

Property: Data type: Description: Default:

(SI: Static Include, PI: PHP Plugin)

template String Location of HTML template file. SI:

fileadmin/template/wm_contentteaser/wm_contentteaser_template.htm

l

PI: None

onClickLightbox Boolean Use Lightboxing to display a

single view of the pic (1) or simple

“On Click Enlarge” (0)

picture IMAGE

object

This TS IMAGE object is used to

render the content teaser picture.

Only some of the properties are

overwritten by the plugin (such as

file), some are defaulted and

most of them are simply used

with the content they have

(possibly set in the TS template).

SI: 0

PI: None

SI: file.maxW=150m, border=0

PI: too complex to document here, please refer to the plugin itself.

HTML-Template

In the HTML Template following markers will be replaced. So, if you want to write your own template it's an important thing to

know. This is the most radical way to adapt the look of the plugin. Please be aware that some markers are only valid in

certain subparts.

Ah, and yes: remember that the plugin has to know where the template is stored and therefore it's a parameter which has to

be set correctly in the TS plugin object.

Subpart TEMPLATE

In this subpart the following markers will be replaced by the PHP plugin:

Marker: Description: Example:

CONTENTHEADER tt_content.header – the heading of the content. Pictures

TEASERHEADLINE … New Fantastic

Pictures!

TEASERTEXT Identically with TEASERHEADLINE to support older version New Fantastic

Pictures!

TEASERIMAGE Full tag highly customizable with TS teaserimage property.

TEASERCONTENT RTE and CSS rendered content of the teaser. bl

abla bla


PAGETITLE pages.title = the name of the page (also in the page tree) Gallery 2008

CONTENTLINK_TEASER A link to the content using the teaser headline as anchor New

Fantastic

Pictures!

CONTENTLINK_HEADER A link to the content using the heading of the content as anchor Pictures

EXT: Content Teaser - 6


Marker: Description: Example:

PAGELINK_TEASER A link to the page where the content resides using the teaser headline as anchor New

Fantastic

Pictures!

PAGELINK_HEADER A link to the page where the content resides using the title of the page as anchor Gallery

2008

Subpart CONTENTTEASER0 / CONTENTEASER1

A single teaser …

It’s possible to specify one, two or even more (in fact as many as you like) subparts named “CONTENTTEASER” plus an

index starting with “0”. Those subparts are used for content rendering alternating: The first teaser is rendered with subpart

CONTENTTEASER0, the second teaser with CONTENTEASER1 (if present, otherwise again with CONTENTTEASER0) and

so on.

In this subpart the following markers will be replaced by the PHP plugin:

Same as above.

Marker: Description: Example:

CSS

The default HTML template given uses following styles. One (not so radical) way to adapt the look of the plugin is to change

those styles and still keep using the default HTML template. Maybe a look into the default HTML template will make thigs

clearer?

OK, you will not forget to alter the page.includeCSS.wm_contentteaser property? You have to put the path and name of your

*.css so that TYPO3 can include your stylesheet. Otherwise your (and your users) browser will not find the definition of your

CSS classes. I always put it in the same TS template which holds the plugin object and it may look like this:

page.includeCSS.wm_contentteaser = fileadmin/template/wm_contentteaser/style.css

Class Name: Description:

Please refer to the default HTML template and the default CSS stylesheet.

EXT: Content Teaser - 7

More magazines by this user
Similar magazines