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.

tt_news Marker

Created:2010-10-13T21:40:33
Changed by:dirk
Changed:2014-10-31T16:25:07
Classification:ttnews_marker
Description:Unlimited marker for tt_news: Use any marker in tt_news! Don't display news lists, if they are emptyAny Marker has the std_wrap property. There are special markers for a link and for counting.
Keywords:tt_news, marker, stdwrap, counting
Author:Dirk Wildt - Die Netzmacher
Email:http://wildt.at.die-netzmacher.de
Website:http://die-netzmacher.de
Language:en

img-1 img-2 tt_news Marker|img-3|

tt_news Marker

Unlimited marker for tt_news: Use any marker in tt_news! Don't display news lists, if they are emptyAny Marker has the std_wrap property. There are special markers for a link and for counting.

img-4

Version: 3.6.0, 2014-10-31

Extension Key: ttnews_marker

Language: en

Keywords: tt_news, marker, stdwrap, counting

Copyright 2009-2014, Dirk Wildt - Die Netzmacher, <http://wildt.at .die-netzmacher.de>

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.org

Introduction

What does it do?

  • The extension tt_news Marker extends tt_news for using
    • user defined markers and
    • system defined markers like for a news URL or item counters and
    • the new codes LIST_ONLY_WITH_ITEMS and LATEST_ONLY_WITH_ITEMS
  • Every self defined marker has the std_wrap property.
  • If you use the extension tt_news select configuration (extkey: ttnews_selectconf) too, you can filter your news items by fe_users for example.

What do you need?

  • The extension tt_news.
  • The extension ttnews_selectconf, if you want to filter news items by SQL properties.
  • A little bit experience with TypoScript.

Installation

Extension Manager

Open the extension manager, download the extension tt_news Marker (extkey: ttnews_marker) and install it.

Frame2

Include Static Template

Frame2

Include the static template from the extension in the template of that page where you are using tt_news plugins. This is the root page probably.

Markers

The tt_news plugin has the new array "extensions" after installation of the extension tt_news Marker.

You can configure extensions for tt_news here.

System Defined Markers

Frame2

There are some so called system defined markers in the default mode.

They have the following meaning:

href
  • Is a link to a news item in the single view.Examples for values are:
    • index.php?id=87&tt_news[tt_news]=1234&...
    • festival/datum/2009/03/26/titel/internationale-figurentheaternaechte- reutlingen/
  • If you like to use the value in your tt_news template use the marker ###HREF###
  • tt_news has the ###LINK_ITEM### for this case. ###HREF### has only a sense, if you want to edit the link. I.e. you need an absolute URL with a foreign host.
  • href has the typolink property only.
num_plugin
  • Is a counter for the used tt_news plugins in the current page.
  • If you like to use the value in your tt_news template use the marker ###NUM_PLUGIN###
  • num_plugin has the std_wrap property.
num_items_cur_plugin
  • Is a counter for the displayed tt_news items in the current plugin.
  • If you use more than one tt_news plugin on the current page, the counter will begin in every next plugin with 1 again.
  • If you like to use the value in your tt_news template use the marker ###NUM_ITEMS_CUR_PLUGIN###
  • num_items_cur_plugin has the std_wrap property.
num_items_cur_page
  • Is a counter for the displayed tt_news items in the current page.
  • If you use more than one tt_news plugin on the current page, the counter will count ahead.
  • If you like to use the value in your tt_news template use the marker ###NUM_ITEMS_CUR_PAGE###
  • num_items_cur_page has the std_wrap property.
std_wrap Property

Every marker item has the std_wrap property but href. href has the typolink property only.

If you want wrap the number of the item as a header use this code f.e:

plugin.tt_news {

extensions {

ttnews_marker {

marker {

num_items_cur_page {

wrap = <h1>|<h1>

}

}

}

}

}

Registers

The values of the system defined markers are stored in registers. The name of the register is the name of the system defined marker in upper case.

You can use the value of every system defined marker in your TypoScript after ttnews_marker is used.

Thanks to Krystian Szymukowicz <k.szymukowicz.at.prolabium.com> for the code snippet.

Example
Code snippet

page.10.subparts.news.40 = TEXT

page.10.subparts.news.40 {

value = ERROR: There isn't any register called NUM_ITEMS_CUR_PAGE. ??

override {

data = register:NUM_ITEMS_CUR_PAGE

}

noTrimWrap = || news are on this page|

}

Frame2 Frame2

The TypoScript code generates a line like in the illustration above on the left hand:

22 news are on this page

In case of an error it will generates

ERROR: There isn't any register called NUM_ITEMS_CUR_PAGE. ?? news are on this page

See the illustration on the right hand.

Error means: Your TypoScript code will be rendered before any tt_news plugin is handled.

User Defined Markers

If you need any marker

  • add the name in uppercase to the HTML template
  • add the name in lowercase to the typscript
Example for a self defined marker a_href

Use ###A_HREF### in the tt_news HTML template like ion the example below:

<!-- ###TEMPLATE_LIST### begin -->

<h2>

<a href="http://www.puppenspiel-portal.eu/ ###A_HREF### " ...

...

Frame2

img-6 Illustration 7: Our marker a_href

Define a typoscript element "a_href" like in the example below: plugin.tt_news {

extensions {

ttnews_marker {

marker {

a_href {

typolink {

parameter = 67

returnLast = url

}

}

}

}

}

}

The output will be a link to the page with the uid 67 i.e:

index.php?id=67

If you are using real_url the link will be processed by real_url and will be something like that:

rubrik/veranstaltungen/

Frame2

Tutorial

We want wrap our tt_news items on the top with a header and on the bottom with a link line.

HTML Template and TypoScript

You see the typoscript with our user defined markers on the left hand in the illustration below.You see the HTML template with our user defined markers on the right hand in the illustration below.

Frame2

HTML Output and Generated Code

You see the HTML output on the left hand in the illustration below.You see the generated HTML code on the right hand in the illustration below.

img-7

Output only if there is an item at least

img-8 Illustration 10: tt_news code LIST_ONLY_WITH_ITEMS

We want an output only, if there is a tt_news item at least. We have to change the tt_news property code

  • from LIST
  • to LIST_ONLY_WITH_ITEMS.

See the typoscript snippet below:

plugin.tt_news {

code = LIST_ONLY_WITH_ITEMS

}

This is possible too:

plugin.tt_news {

code = LATEST_ONLY_WITH_ITEMS

}

Reference

System Markers

href

Property

href

Data type

typolink

Description

This marker has the typolink property and a special additonalParams property. All values of additionalParams will be added to the existing params.

Typoscript example:

plugin.tt_news.extensions.ttnews_marker.marker {
  href {
    additionalParams = &type=0
  }
}

HTML template example:

<a href="###HREF###" title="...

Default

num_plugin

Property

num_plugin

Data type

std_wrap

Description

This marker displays the number of the used tt_news plugin.

If you use three plugins f.e, all tt_news items of the first plugin will get the number 1 in front of the news title, all tt_news items of the second plugin will get the number 2 in front of the news title and all tt_news items of the third plugin will get the number 3 in front of the news title in the example below.

Typoscript example:

plugin.tt_news.extensions.ttnews_marker.marker {
  num_plugin {
    wrap = <strong>|:</strong>
  }
}

HTML template example:

###NUM_PLUGIN### ###NEWS_TITLE###

Default

num_items_cur_plugin

Property

num_items_cur_plugin

Data type

std_wrap

Description

This marker displays the number of the used tt_news item in the current plugin.

If you use two plugins f.e, all tt_news items in the first plugin will counted from one to the last number of the news in this plugin, and all news items in the second plugin will be counted from one to the last number of the last news item of the second plugin. See the example below.

Typoscript example:

plugin.tt_news.extensions.ttnews_marker.marker {
  num_items_cur_plugin {
    wrap = <strong>|:</strong>
  }
}

HTML template example:

###NUM_ITEMS_CUR_PLUGIN### ###NEWS_TITLE###

Default

num_items_cur_page

Property

num_items_cur_page

Data type

std_wrap

Description

This marker displays the number of all used tt_news in a page.

Typoscript example:

plugin.tt_news.extensions.ttnews_marker.marker {
  num_items_cur_page {
    wrap = <strong>|:</strong>
  }
}

HTML template example:

###NUM_ITEMS_CUR_PAGE### ###NEWS_TITLE###

Default

User Defined Markers

marker

Property

marker

Data type

std_wrap

Description

marker is a self defined element in the array marker. It has the std_wrap property. See the examples below with the self defined marker "my_marker"

HTML marker:

###MY_MARKER###

Typoscript example I:

plugin.tt_news.extensions.ttnews_marker.marker {
  my_marker {
    value = My Title
    wrap = <h1>|</h1>
  }
}

HTML result:

<h1>My Title</h1>

Use the field property, if you need a value from the current news record. We take the title field of a tt_news and crop in the example below:

Typoscript example II:

plugin.tt_news.extensions.ttnews_marker.marker {
  my_marker {
    field = title
    wrap = <h1>|</h1>
    crop = 20|...|1
  }
}

HTML result:

<h1>The Title of the ...</h1>

Use the field property, if you need a value from the current news record. We take the title field of a tt_news and crop in the example below:

Typoscript example III:

plugin.tt_news.extensions.ttnews_marker.marker {
  my_marker {
    typolink {
      parameter  = 67
      returnLast = url
    }
  }
}

HTML result:

index.php?id=67                 // Without Real-URL
my_path1/my_path2/my_page       // With Real-URL

Default

Code

code

Property

code

Data type

tt_news.code

Description

Set the tt_news property code like in the example below, if you don't want any HTML in LIST view if there isn't any tt_news item.

Typoscript example:

plugin.tt_news {
  code = LIST_ONLY_WITH_ITEMS
}

plugin.tt_news {
  code = LATEST_ONLY_WITH_ITEMS
}

Default

FAQ

SimulateStaticDocuments and RealURL

There isn't any known problem with SimulateStaticDocuments or RealURL.

Changelog

3.6.0 Major Feature * #i0001: Upgrade TYPO3 6.2

1.0.1 New features * Handling for internal and external links was addedThanks to Stefan Kroecher <s.kroecher.at.gingco.net> for the code snippet* Values of system markers are stored in TypoScript registersThanks to Krystian Szymukowicz <k.szymukowicz.at.prolabium.com> for the code snippet

1.0.0 New Main Version * Changed status to stable

0.1.1 New Feature * Code LATEST_ONLY_WITH_ITEMS

0.0.6 Maintenance * Update the manual

0.0.5 Maintenance * Update the manual

0.0.3 Changed extKey * Initial release of ttnews_href_marker is obsolete now

0.0.2 Publishing

0.0.1 Initial release * As ttnews href marker (extkey: ttnews_href_marker)

Further Information

Feature Requests and Suggestions

If you have helpful suggestions please send an e-mail to http://wildt.at.die-netzmacher.de

Professional Support

If you need professional support, please refer to

Other extensions published by Die Netzmacher

  • img-9 +AOE Linkhandler Configurator: Configure the AOE linkhandler supported by userinterfaces. Out-of-the-box templates for cal, org, tt_news and tt_products. Don't edit page TSconfig any longer. http://typo3.org/extensions/repository/view/linkhandlerconf/
  • img-10 autositemap: A smart site-map optimised for the footer. It groups menus in columns. Great menus will get two columns. Configuration is based on TypoScript HMENU. http://typo3.org/extensions/repository/view/autositemap/
  • img-11 Browser – TYPO3 without PHP. Develop your TYPO3 extension 8 times faster! You need one line TypoScript for a result list with a search form, a record browser and an index browser. Images are wrapped self-acting. SEO, Search Engine Optimization, is integrated. http://typo3.org/extensions/repository/view/browser/
  • img-12 Caddy – the TYPO3 shopping cart. You can use it for your own needs. You need a database with products or any other items only. You can install Caddy out of the box with one mouse click – see Quick Shop below. http://typo3.org/extensions/repository/view/caddy/
  • img-12 Deal! – TYPO3 Quick Shop interface for the marketplace ebay. Manage all items with TYPO3 and publish it on ebay. Amazon is under construction. http://typo3.org/extensions/repository/view/deal/
  • img-13 Duty – collection of helpful scheduler tasks. Here: remove deprecated files from directories. http://typo3.org/extensions/repository/view/duty/
  • img-14 Flip it! offers lovely and smooth page flip transitions. It enables you to run over pages in PDF documents like in a real magazine. It is based on flash. Flipt it! can convert PDF documents to swf files automatically. http://typo3.org/extensions/repository/view/flipit/
  • img-15 Jobmarket is a catalogue with job offers. Views, the a-z-browser, the page-browser, the search, social bookmarks and a lot of other stuff can configured by the Browser plugin with the mouse. Job Market hasn't any PHP code, it should be easy to adapt it to your needs. http://typo3.org/extensions/repository/view/job_market/
  • img-16 Organiser – TYPO3 for the lobby and the organisers. Handle news, events, staff, headquarters, locations, workshops and a calendar with one extension. Sell online tickets! Install the Organiser with one mouse click! http://typo3-organiser.de/
  • img-12 Quick Shop – the fastest shop in the history of TYPO3. Install it with one mouse click! Quick Shop is based on the browser (see above) and powermail. http://typo3-quick-shop.de/
  • img-17 PDF Controller: Easy to install. Add to your HTML page the PDF-controller-button. Link from the button to the controller. Adjust the controller by mouseclicks. The PDF Controller supports CSS 3. http://typo3-pdfcontroller.de/
  • img-18 Radial Search (Umkreissuche) – Enable the browsing through your data by geo location. 'Your data must have a latitude and a longitude. Address data can geocoded automatically by the Browser - TYPO3 without PHP. http://typo3.org/extensions/repository/view/radialsearch/
  • img-18 Route – Publish your routes with GoogleMaps or OpenStreetMap. Routes have points of interest (POI). You can categorise and filter both: routes and POI. Address data can geocoded automatically. http://typo3.org/extensions/repository/view/route/
  • img-19 seo_dynamic_tag: Search Engine Optimization for the title tag, the canonical tag and the meta tags author, description and keywords. Configuration by a user interface. http://typo3.org/extensions/repository/view/seo_dynamic_tag/
  • img-20 Slick - jQuery Carousel: Fully responsive. Scales with its container. Separate settings per breakpoint. Uses CSS3 when available. Swipe enabled. Desktop mouse dragging. Infinite looping. Fully accessible. http://typo3.org/extensions/repository/view/slick/
  • img-21 TSconfig Pages and Users by extManager (extkey: tsconf): Configure the the eight most commonly used TSconfig porperties with the mouse - like page tree uids, activated extended view, activated clipboard, ... http://typo3.org/extensions/repository/view/tsconf/

Illustration Index

Illustration 1: Loaded extension tt_news Marker 4

Illustration 2: Include the static template tt_news Marker 4

Illustration 3: The extensions array with so called system defined markers 5

Illustration 4: In case of success 6

Illustration 5: In case of an error 6

Illustration 6: HTML template with self defined markers 7

Illustration 7: Our marker a_href 7

Illustration 8: The HTML output 7

Illustration 9: TypoScript and HTML template with user defined markers 8

Illustration 10: tt_news code LIST_ONLY_WITH_ITEMS 8

Change log

3.6.0 Major Feature * #i0001: Upgrade TYPO3 6.2

1.0.1 New features * Handling for internal and external links was addedThanks to Stefan Kroecher <s.kroecher.at.gingco.net> for the code snippet* Values of system markers are stored in TypoScript registersThanks to Krystian Szymukowicz <k.szymukowicz.at.prolabium.com> for the code snippet

1.0.0 New Main Version * Changed status to stable

0.1.1 New Feature * Code LATEST_ONLY_WITH_ITEMS

0.0.6 Maintenance * Update the manual

0.0.5 Maintenance * Update the manual

0.0.3 Changed extKey * Initial release of ttnews_href_marker is obsolete now

0.0.2 Publishing

0.0.1 Initial release * As ttnews href marker (extkey: ttnews_href_marker)

16