Login / Status
developer.Resource
Home . Documentation . Document Library . Extension Manuals
Sponsors
hosted by punkt.deTYPO3 and Open Source MagazineAOE Media

1.5. Extending tt_news

There are several possibilities to extend/change the functionality of tt_news without building a new extension (see list below). If you need additional fields in the BE-Form, you can create an extension with the kickstarter, that adds the new fields to the tt_news database-table. After this, take a look to the file EXT:tt_news/res/example_itemMarkerArrayFunc.php for an example, how to display the contents of an additional field with a userdefined marker.

You can also have a look at the extensions “news_author_rel” and “news_dam_con” which show how to extend tt_news by a field. “news_author_rel” offers also a single view for related records.

Another code example for using the hook in function getItemMarkerArray() can be found in the extension chcnewscon. So there should be enough “sources” to copy & paste your own “news_special_extended” extension.

Good Luck ;-)Here the list of the userfunctions:

  1. “newsAmenuUserFunc”: for processing the archive menu -> see example in folder res/

  2. “itemMarkerArrayFunc”: for processing the complete marker array  -> see example in folder res/

  3. “imageMarkerFunc”: gives you the possibility to process the image markers by a user function. This userfunction works a bit different from the others: if it is enabled, the images are only processed by the userfunction not by both functions. (this could already be done by the “itemMarkerArrayFunc” but this would process the same images two times) Added an new example script: “res/example_imageMarkerFunc.php” that uses the new userfunction to add different wraps to the images in single view (see comments in file for needed TS-settings)   -> see example in folder res/

  4. “userPageBrowserFunc”: With this userfunction you can substitute the build-in pagebrowser from tt_news with your own script. See file: “res/example_userPageBrowserFunc.php”. With the two example-pagebrowsers from this file it is possible, to use html-code like images for the “next” and “previous” links.

  5. you can define different template parts with: “altMainMarkers” -> see example in “Reference”.

There are 6 function-“hooks” in the tt_news extension:

  1. you can add extra-codes to the FF sheets with the function from “class.tx_ttnews_itemsProcFunc.php”: This function is called from the flexform xml files by using “tx_ttnews_itemsProcFunc->user_insertExtraCodes” this adds the “codes” to the “What to display” selectbox, that are found in the array: $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tt_news']['what_to_display'].

  2. Hook for processing the extra codes in function main_news() (extraCodesProcessor).

  3. Hook for processing extra markers for each news record in function getItemMarkerArray() (extraItemMarkerProcessor) .

  4. Hook for processing the selectConf-array in function getSelectConf() (processSelectConfHook).

  5. Hook for processing extra markers for the complete output in function displayList() (extraGlobalMarkerHook) .

  6. Hook for adding a userdefined category menu (catmenu) in function displayCatmenu() (userDisplayCatmenuHook) .

For more information about hooks see: TYPO3 Core APIs / The concept of "hooks"and: http://typo3.org/development/articles/how-to-use-existing-hooks/