TYPO3/TypoScript
TYPO3/TypoScript: How to add Page Updated Timestamp
Mar 8th
This little typoscript adds a last updated timestamp, include using TemplaViola
Do you want mp3 music download on perssonal computer, Don’t know where download mp3 music for mp3 player.
- ## Last Updated [Begin]
- lib.lastUpdated.data = page:SYS_LASTCHANGED
- lib.lastUpdated.strftime = %d-%m-%Y %H:%M
- lib.lastUpdated.wrap = <p>Updated: |</p>
- ## Last Updated [End]
TYPO3: Changing the tt_news template markup
May 16th
The easy way is to change xhtml setup for the tt_news extension is to back up the div-based tt_news template, and put it somewhere in the fileadmin folder, where you have placed other template stuff such as your general xhtml template for the website. Make your markup changes to the template, and change the tt_news configuration to use the modified template like below.
### Template File ### plugin.tt_news.templateFile = fileadmin/templates/ext/tt_news_v2_template.html
TYPO3: Setting XHTML 1.1 DOCTYPE
Apr 10th
How to change the DocType in the TYPO3 template setup.
- config.doctype = xhtml_11
- config.xhtmlDoctype = xhtml_11
- config.xmlprologue = none
- config.xhtml_cleaning = all
The DOCTYPE can be set to these values:
xhtml_trans (XHTML 1.0 Transitional doctype)
xhtml_frames(XHTML 1.0 Frameset doctype)
xhtml_strict (XHTML 1.0 Strict doctype)
xhtml_basic (XHTML basic doctype)
xhtml_11 (XHTML 1.1 doctype)
xhtml_2 (XHTML 2 doctype)
none (NO doctype at all)
The XML prologue can be set to these values:
xml_10 (XML 1.0 prologue)
xml_11 (XML 1.1 prologue)
none (the default XML prologue is not set)
The XHTML cleaning can be enabled by the following values:
all (the content is always processed before it may be stored in cache)
cached (only if the page is put into the cache)
output (only the output code just before it’s echoed out)
Further information about setting the doctype is available in the TSref.
TYPO3: Add tt_news LATEST as TypoScript Object
Apr 2nd
This shows how to place a news block on a webpage. When using TemplaVoila you can map tt_news LATEST as a TypoScript Object to a specific place in your HTML Template, and it’s possible to narrow it down to certain pages, where the LATEST Object is added in place of other content.
- ### News LATEST in left column on certain pids
- lib.newsLatest {
- code >
- code = LATEST
- pid_list >
- pid_list = 78,134 # the pids where news are stored
- catImageMode = 0
- catTextMode = 0
- }
- lib.sidebar < lib.newsLatest
- [else]
- # Put something else in the lib.sidebar
- temp.sidebar.value = <p>Something else</p>
- lib.sidebar < temp.sidebar
- [end]
TYPO3: tt_news LIST and SINGLE at the same page
Apr 2nd
The following TS code enables the feature of showing the tt_news list and the tt_news single view at the same page.
- # Clear the code field
- # Prevent indexing of the LIST view
- config.index_enable = 0
- [globalVar = GP:tx_ttnews|swords = ]
- # Do nothing (reverse hack)
- [else]
- # Set code to SEARCH if swords (search is done) exists
- [end]
- [globalVar = GP:tx_ttnews|tt_news > 0]
- # Set code to SINGLE, if the GETvar tx_ttnews[tt_news] exists
- # Enable indexing of the SINGLE view
- config.index_enable = 1
- [global]
TYPO3: XHTML Valid 3 Level Menu in Typoscript
Mar 29th
This is sort of a long snippet, but anyway it is an example of making a vertical 3 level menu, which expand and collapse according to the active and current chosen list-item / page. The menu made as nested unordered list, and further it is wrapped in a box made of divs, where the title of active parent page to the menu is shown. The pattern of the typoscript menu could be repeated, if a fourth level is wanted, and it could be shortened to a 1 or 2 level menu.
- ## SubMenu [Begin]
- # Removes the menubox from the page ids: 19, 23 (if the page does not have subpages, you don’t want an empty box)
- # do nothing (PIDupinRootline doesn’t seem to work?)
- [else]
- boxtop = TEXT
- # get the title of the page on the first level of the rootline.
- boxtop.data = leveltitle:1
- boxtop.wrap = <div class="columnbox"><div class="columnbox-top">|</div><div class="columnbox-content">
- boxbottom = TEXT
- boxbottom.value = </div><div class="columnbox-bottom"></div></div>
- [end]
- lib.subMenu {
- # include top of columnbox
- 9 < boxtop
- # making the menu
- 10 = HMENU
- # defines the menu entrylevel
- 10.entryLevel = 1
- 10.1 {
- noBlur = 1
- CUR = 1
- IFSUB= 1
- }
- # Formatting of menu normal entries as list items.
- wrapItemAndSub = <li class="normal minus">|
- }
- # Current menu item is unlinked and wrapped in span
- wrapItemAndSub = <li id="current" class="minus">|</li>
- doNotLinkIt = 1
- allWrap = <span>|</span>
- }
- # If the menu item has subs add class plus to change icon to it has subs
- wrapItemAndSub = <li class="normal plus">|</li>
- }
- # Active items above current to be formatted differently
- wrapItemAndSub = <li class="active minus">|</li>
- }
- # Wrap the first level of the menu inside an unordered list
- 10.1.wrap = <ul class="cb-menu">|</ul>
- 10.2 {
- noBlur = 1
- CUR = 1
- IFSUB= 1
- }
- # Same formatting of menu entries as list items.
- wrapItemAndSub = <li class="normal minus">|</li>
- ATagParams =
- }
- # Current menu item is unlinked and marked too
- wrapItemAndSub = <li id="current" class="minus">|</li>
- doNotLinkIt = 1
- allWrap = <span>|</span>
- }
- # If the menu item has subs add class plus to change icon
- wrapItemAndSub = <li class="normal plus">|</li>
- }
- # Active items above current to be formatted differently as for first level
- wrapItemAndSub = <li class="active minus">|</li>
- }
- # Wrap the second level of the menu inside an unordered list
- 10.2.wrap = <ul class="cb-submenu">|</ul>
- 10.3 {
- noBlur = 1
- CUR = 1
- IFSUB = 1
- }
- # Same formatting of menu entries as list items.
- wrapItemAndSub = <li class="normal minus">|</li>
- ATagParams =
- }
- # Current menu item is unlinked and marked too
- wrapItemAndSub = <li id="current" class="minus">|</li>
- doNotLinkIt = 1
- allWrap = <span>|</span>
- }
- # If the menu item has subs add class plus to change icon
- wrapItemAndSub = <li class="normal plus">|</li>
- }
- # Active items above current to be formatted differently as for higher levels
- wrapItemAndSub = <li class="active minus">|</li>
- }
- # Wrap the third level of the menu inside an unordered list
- 10.3.wrap = <ul class="cb-subsubmenu">|</ul>
- # end of columnbox
- 11 < boxbottom
- }
- ## SubMenu [End]





