CoSchni#10: TYPO3 CMS Register

Im TypoScript kann auf verschiedene Konstanten bzw. Register zurückgegriffen werden. Diese beinhalten z.B. die Anzahl vom Menüelementen bei der jeweiligen Seite oder viele andere Sachen. Der häufigste Anwendungszweck den ich bisher kenne, ist die dynamische Aufteilung des Menüs in zwei Teile, wie in diesem Beispiel verdeutlicht: http://www.typo3wizard.com/de/snippets/menus/menue-dynamisch-in-2-teile-aufteilen.html

Neben dem Register “count_menuItems” gibt es noch eine Reihe weiterer. Die einzige Dokumentation die ich bisher kenne, ist im Bugtracker (http://forge.typo3.org/issues/11564) von Francois Suter und schon über zwei Jahre alte. Die letzte Aktualisierung erfolgte jedoch vor 28 Tagen, von daher gehe ich aus, das es aktuell ist. Nachfolgend mal alle Register aufgeschlüsselt:

[PHP]
class.tx_cssstyled_content_pi1.php

function render_uploads($content,$conf) – Rendering the “Filelinks” type content element, called from TypoScript (tt_content.uploads.20):
$GLOBALS[‘TSFE’]->register[‘ICON_REL_PATH’] – keeps relative path to file + filename
$GLOBALS[‘TSFE’]->register[‘filename’] – self-explainable
$GLOBALS[‘TSFE’]->register[‘path’] – self-explainable
$GLOBALS[‘TSFE’]->register[‘fileSize’] – self-explainable
$GLOBALS[‘TSFE’]->register[‘fileExtension’] – self-explainable
$GLOBALS[‘TSFE’]->register[‘description’] – description for current file from ‘imagecaption’ field
$GLOBALS[‘TSFE’]->register[‘linkedIcon’] – not sure about that, but I think is is bool value, defining, should file icon be linked or not
$GLOBALS[‘TSFE’]->register[‘linkedLabel’] – same as above, but for label

function render_textpic($content, $conf) – Rendering the IMGTEXT content element, called from TypoScript (tt_content.textpic.20)
$GLOBALS[‘TSFE’]->register[‘imageCount’] – count of all image in block
$GLOBALS[‘TSFE’]->register[‘renderGlobalCaption’] – bool value, which defines, shoul a global caption be rendered below image block
$GLOBALS[‘TSFE’]->register[‘IMAGE_NUM’] – number of current image in set (DEPRECATED)
$GLOBALS[‘TSFE’]->register[‘IMAGE_NUM_CURRENT’] – number of current image in set (not deprecated :))
$GLOBALS[‘TSFE’]->register[‘ORIG_FILENAME’] – path to the image + image name
$GLOBALS[‘TSFE’]->register[‘imagewidth’] – self-explainable
$GLOBALS[‘TSFE’]->register[‘imagespace’] – self-explainable
$GLOBALS[‘TSFE’]->register[‘imageheight’] – self-explainable
$GLOBALS[‘TSFE’]->register[‘rowwidth’] – width of whole block of images
$GLOBALS[‘TSFE’]->register[‘rowWidthPlusTextMargin’] – same, as above + margin to the text
$GLOBALS[‘TSFE’]->register[‘columnwidth’] – maximum possible width of image block + spaces at left and right side of block
$GLOBALS[‘TSFE’]->register[‘totalwidth’] – not sure, but I guess it is same as $GLOBALS[‘TSFE’]->register[‘rowwidth’]

class.tslib_content.php

function IMGTEXT
$GLOBALS[‘TSFE’]->register[‘IMAGE_NUM’]
$GLOBALS[‘TSFE’]->register[‘IMAGE_NUM_CURRENT’]

function HMENU
$GLOBALS[‘TSFE’]->register[‘count_HMENU’] – current number of a generated HMENU on a website
$GLOBALS[‘TSFE’]->register[‘count_HMENU_MENUOBJ’] – number of current menu item for current HMENU object

function SEARCHRESULT
$GLOBALS[‘TSFE’]->register[‘SWORD_PARAMS’] – search words

function TEMPLATE
$GLOBALS[‘TSFE’]->register[‘SUBPART_’.$theKey] – contains html code of subpart, defined by $theKey

public function SWFOBJECT
$GLOBALS[‘TSFE’]->register[‘MMSWFID’] – not sure, what it used for, but it holds: uniqid(‘mmswf’);

public function QTOBJECT
$GLOBALS[‘TSFE’]->register[‘MMQTID’] – uniqid(‘mmqt’);

function lastChanged($tstamp) – Sets the SYS_LASTCHANGED timestamp
$GLOBALS[‘TSFE’]->register[‘SYS_LASTCHANGED’] – timestamp of page (or content on current page) last modification

function splitObj($value, $conf) – Implements the “split” property of stdWrap; Splits a string based on a token (given in TypoScript properties), sets the “current” value to each part and then renders a content object pointer to by a number.
$GLOBALS[‘TSFE’]->register[‘SPLIT_COUNT’] – current number of item in split

class.tslib_menu.php
function makeMenu() – Creates the menu in the internal variables, ready for output.
$GLOBALS[‘TSFE’]->register[‘count_menuItems’] – number of all items in current menu

function subMenu($uid, $objSuffix=”) – Creates a submenu level to the current level – if configured for.
$GLOBALS[‘TSFE’]->register[‘count_menuItems’] – as I understood this register holds number of items not for the whole menu, but for current menu level

function writeMenu() – Traverses the result array of menu items configuration (made by generate()) and renders each item.
$GLOBALS[‘TSFE’]->register[‘count_HMENU_MENUOBJ’] – number of current menu item for current HMENU object
$GLOBALS[‘TSFE’]->register[‘count_MENUOBJ’] – number of current menu item for ALL HMENU objects on a page
[/PHP]

[random_content group_id=”211" num_posts=”1"]

Leave a Reply

Your email address will not be published. Required fields are marked *