DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

EXT: Mininews

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed by:Dmitry Dulepov
Changed:2006-10-02T17:17:19
Author:Dmitry Dulepov
Email:typo3@accio.lv
Info 3:
Info 4:

EXT: Mininews

Extension Key: mininews

Copyright 2006-..., , <typo3@accio.lv>

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

EXT: My Extension 1

Introduction 1

What does it do? 1

Screenshots 1

Users manual 1

FAQ 1

Adminstration 1

FAQ 2

Configuration 2

FAQ 2

Reference 2

Tutorial 2

Known problems 2

To-Do list 2

Changelog 2

Introduction

What does it do?

This extension is a simple lightweight news system. News can be displayed as frontend teaser, article list or single news view. News articles have date, teaser and rich text editor for news item.

Extension also serves as example of extension programming.

Screenshots

News records in List view:

img-1

img-2 News record edit view:

img-3 News listing (search disabled):

img-4 Single view:

Users manual

To create news entry, go to Web>List view. Select a page in the page tree where news records are stored (ask your TYPO3 administrator of you do not know). You will be presented with properties of news record as shown on the screenshot named “News record edit view”.

Enter date and tine of the news item (or click a checkbox to insert current). Enter teaser and main text. If you do not enter teaser text, it will be generated automatically from main text. Check “Show on front page?” if news item should show on front page.

Administration

((generated))

Using in TypoScript

Extension can be used and fully controlled from TypoScript. All options are described in details in Reference section of this manual.

Generally plugin is inserted several times depending on the mode (frontpage listing, archive view or singleView).

Example: frontpage listing

Here you would show an example of the stuff from the reference or so:

temp.fpListing < plugin.tx_mininews_pi1
temp.fpListing.CMD = FP
Example: archive listing

Here you would show an example of the stuff from the reference or so:

temp.fpListing < plugin.tx_mininews_pi1
temp.fpListing.CMD = listView
Using as content element

Create a new content element of Mininews type (in Plugins section). The following options are available:

img-5

“Listing mode” consists from the following choices (self-explanatory):

  • Archive/search
  • Frontpage teaser

Archive/search page also shows single view.

“Page where news records stored” must reference page where news items are stored. If not set, current page is assumed.

“Page with archive/search” is shown only if “Listing mode” is set to “Frontpage teaser” and defines a page where archive/search is displayed. There must be an instance of this plugin configured with “Archive/search” mode.

“Results at a time” defines how many results extension will display in archive and frontpage mode.

“Look for records recursively” allows to do recursive search for records. Depending on a number of nested pages, it may take a lot of time. Recommended to uncheck.

“Disable search” lets you to disable search box at the end of archive view. It is shown only if “Archive/search” mode is selected. This is ignored if “Template object for formatting” is not empty because template object defines formatting in that case.

“Template object for formatting” allows you to choose TemplaVoila template for formatting extension's output. To use this option TemplaVoila extension must be installed and corresponding template object created. If template is not selected, default formatting will be used.

Generally you need to insert plugin on two different pages: on a front page of your site (to provide frontpage listing) and on another page to show news archive.

Cache issues

Since news records are usually stored on a page that is different from the main page of the site, news normally do not popup on front page immediately. Users can clear cache to show news but this may impact system performance if the whole page cache is cleared. Instead TYPO3 administrator can add the following piece of code to TSConfig field of page properties and cache will be cleaned automatically when news record is inserted:

TCEMAIN.clearCacheCmd = 1,3

Here 1 and 3 are UIDs of the front page and page where archive is displayed. Notice that there are no spaces between numbers.

Here is a screen shot of page record with this entry added:

img-6

Creating TemplaVoila template

Mininews can use TemplaVoila for formatting results. TemplaVoila offers easy point and click interface to map parts of HTML file to record properties.

To create TemplaVoila template you must have TemplaVoila extension installed. If you are not familiar with TemplaVoila, you should read Futuristic Template Building tutorial before continuing here.

Go to the Web>TemplaVoila and select your general record storage folder. Click “Other” tab. You will see a section named “Mininews Template” and “Create new template object” below. Click on the “Create...” link and fill in template information. You can start with provided sample HTML template (EXT:mininews/template/mininews_template.html). Map the template paying attension to text fields. If you use provided template, map them to “<span>” tags inside “<p><a>” tags. Notice that there are two link fields for each view. You can use one or both. If one of them is not mapped, it is ignored.

If you do not want to map template yourself, you can attempt to import mapped template. It is located in “EXT:mininews/template/mapped_template.t3d” file. Template record for this file is stored on the page with UID=2 but you must import it to your generic record storage page.

Configuration

TypoScript Reference

CMD

Property

CMD

Data type

string

Description

Defines plugin operation mode. Valid values are:

  • FP
  • listView

which corresponds to:

  • Frontpage listing
  • List view

Single view is shown on the same page where archive (listView) is shown.

Default

not set

dateFormat

Property

dateFormat

Data type

string

Description

Defines date formatting. See PHP function date() for format symbols

Default

%d-%m-%y

dateTimeFormat

Property

dateTimeFormat

Data type

string

Description

Defines date formatting. See PHP function date() for format symbols

Default

%d-%m-%y %H:%M

listView.disableDateDisplay

Property

listView.disableDateDisplay

singleView.disableDateDisplay

Data type

boolean

Description

Disables appearance of the date in news item

Default

0

listView.disableSearch

Property

listView.disableSearch

Data type

boolean

Description

Disables appearance of search box in the news item

Default

0

listView.results_at_a_time

Property

listView.results_at_a_time

frontPage.results_at_a_time

Data type

int

Description

Show this many result on a page

Default

3

listView.maxPages

Property

listView.maxPages

Data type

int

Description

Show this many pages

Default

2

listView.teaserLgd

Property

listView.teaserLgd

fontPage.teaserLgd

Data type

int

Description

If no teaser given, main text will be ut at this number of characters

Default

200

listView.HR_code

Property

listView.HR_code

Data type

string

Description

Insert this string before each news item. Depreciated and can be removed in future. Use CSS styles instead!

Default

<hr />

frontPage.archivePid

Property

frontPage.archivePid

Data type

int

Description

UID of the page with frontpage listing

Default

not set

CSS class reference

Extension uses the following CSS classes:

DIV.tx-mininews-pi1

CSS class name

DIV.tx-mininews-pi1

Usage

Wraps the whole output

DIV.tx-mininews-pi1-listrow-first

CSS class name

DIV.tx-mininews-pi1-listrow-first

Usage

First list row in archive view

DIV.tx-mininews-pi1-listrow-normal

CSS class name

DIV.tx-mininews-pi1-listrow-normal

Usage

One list row in archive view

DIV.tx-mininews-pi1-listrow-last

CSS class name

DIV.tx-mininews-pi1-listrow-last

Usage

Last list row in archive view

P.tx-mininews-pi1-listrowField-datetime

CSS class name

P.tx-mininews-pi1-listrowField-datetime

Usage

Date/time field in archive view

P.tx-mininews-pi1-listrowField-title

CSS class name

P.tx-mininews-pi1-listrowField-title

Usage

News title in archive view

P.tx-mininews-pi1-listrowField-teaser

CSS class name

P.tx-mininews-pi1-listrowField-teaser

Usage

News teaser in archive view

DIV.tx-mininews-pi1-fp_listrow-first

CSS class name

DIV.tx-mininews-pi1-fp_listrow-first

Usage

First list row in front page listing view

DIV.tx-mininews-pi1-fp_listrow-normal

CSS class name

DIV.tx-mininews-pi1-fp_listrow-normal

Usage

One list row in front page listing view

DIV.tx-mininews-pi1-fp_listrow-last

CSS class name

DIV.tx-mininews-pi1-fp_listrow-last

Usage

Last list row in front page listing view

P.tx-mininews-pi1-fp_listrowField-datetime

CSS class name

P.tx-mininews-pi1-fp_listrowField-datetime

Usage

Date/time field in front page listing view

P.tx-mininews-pi1-fp_listrowField-title

CSS class name

P.tx-mininews-pi1-fp_listrowField-title

Usage

News title in front page listing view

P.tx-mininews-pi1-fp_listrowField-teaser

CSS class name

P.tx-mininews-pi1-fp_listrowField-teaser

Usage

News teaser in front page listing

Priority for list rows is first-last-normal. I.e. if there is only one row, it will be the first row. If there are two rows, there will be first and last. If there are three or more rows, there will be first, several normal and one last row.

Changelog

See ChangeLog file in the extension's main directory.

img-7 EXT: Mininews - 7