TYPO3/TypoScript

TYPO3/TypoScript: How to add Page Updated Timestamp

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.

  1. ## Last Updated [Begin]
  2. lib.lastUpdated = TEXT
  3. lib.lastUpdated.data = page:SYS_LASTCHANGED
  4. lib.lastUpdated.strftime = %d-%m-%Y %H:%M
  5. lib.lastUpdated.wrap = <p>Updated: |</p>
  6. ## Last Updated [End]

TYPO3: Changing the tt_news template markup

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

How to change the DocType in the TYPO3 template setup.

  1. config.doctype = xhtml_11
  2. config.xhtmlDoctype = xhtml_11
  3. config.xmlprologue = none
  4. 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

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.

  1. ### News LATEST in left column on certain pids
  2. [PIDinRootline = 57,98]
  3. lib.newsLatest < plugin.tt_news
  4. lib.newsLatest {
  5.         code >
  6.         code = LATEST
  7.         pid_list >
  8.         pid_list = 78,134 # the pids where news are stored
  9.         catImageMode = 0
  10.         catTextMode = 0
  11.   }
  12. lib.sidebar < lib.newsLatest
  13. [else]
  14. # Put something else in the lib.sidebar
  15. temp.sidebar = TEXT
  16. temp.sidebar.value = <p>Something else</p>
  17. lib.sidebar < temp.sidebar
  18. [end]

TYPO3: tt_news LIST and SINGLE at the same page

The following TS code enables the feature of showing the tt_news list and the tt_news single view at the same page.

  1. # Clear the code field
  2. plugin.tt_news.code >
  3. plugin.tt_news.code = LIST
  4. # Prevent indexing of the LIST view
  5. config.index_enable = 0
  6.  
  7. [globalVar = GP:tx_ttnews|swords = ]
  8. # Do nothing (reverse hack)
  9. [else]
  10. # Set code to SEARCH if swords (search is done) exists
  11. plugin.tt_news.code = SEARCH
  12. [end]
  13.  
  14. [globalVar = GP:tx_ttnews|tt_news > 0]
  15. # Set code to SINGLE, if the GETvar tx_ttnews[tt_news] exists
  16. plugin.tt_news.code = SINGLE
  17. # Enable indexing of the SINGLE view
  18. config.index_enable = 1
  19. [global]

TYPO3: XHTML Valid 3 Level Menu in Typoscript

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.

  1. ## SubMenu [Begin]
  2. # Removes the menubox from the page ids: 19, 23 (if the page does not have subpages, you don’t want an empty box)
  3. [PIDinRootline = 19,23]
  4. # do nothing (PIDupinRootline doesn’t seem to work?)
  5. [else]
  6. boxtop = TEXT
  7. # get the title of the page on the first level of the rootline.
  8. boxtop.data = leveltitle:1
  9. boxtop.wrap = <div class="columnbox"><div class="columnbox-top">|</div><div class="columnbox-content">
  10. boxbottom = TEXT
  11. boxbottom.value = </div><div class="columnbox-bottom"></div></div>
  12. [end]
  13.  
  14. lib.subMenu = COA
  15. lib.subMenu {
  16.         # include top of columnbox
  17.         9 < boxtop
  18.         # making the menu
  19.         10 = HMENU
  20.         # defines the menu entrylevel
  21.         10.entryLevel = 1
  22.         10.1 = TMENU
  23.         10.1 {
  24.                 noBlur = 1
  25.                 CUR = 1
  26.                 IFSUB= 1
  27.                 ACTIFSUB = 1
  28.         }
  29.        
  30.         # Formatting of menu normal entries as list items.
  31.         10.1.NO {
  32.                 wrapItemAndSub = <li class="normal minus">|
  33.         }
  34.         # Current menu item is unlinked and wrapped in span
  35.         10.1.CUR {
  36.                 wrapItemAndSub = <li id="current" class="minus">|</li>
  37.                 doNotLinkIt = 1
  38.                 allWrap = <span>|</span>
  39.         }
  40.         # If the menu item has subs add class plus to change icon to it has subs
  41.         10.1.IFSUB {
  42.                 wrapItemAndSub = <li class="normal plus">|</li>
  43.         }
  44.         # Active items above current to be formatted differently
  45.         10.1.ACTIFSUB {
  46.                 wrapItemAndSub = <li class="active minus">|</li>
  47.         }
  48.        
  49.         # Wrap the first level of the menu inside an unordered list
  50.         10.1.wrap = <ul class="cb-menu">|</ul>
  51.  
  52.         10.2 = TMENU
  53.         10.2 {
  54.                 noBlur = 1
  55.                 CUR = 1
  56.                 IFSUB= 1
  57.                 ACTIFSUB = 1
  58.                         }
  59.         # Same formatting of menu entries as list items.
  60.         10.2.NO {
  61.                 wrapItemAndSub = <li class="normal minus">|</li>
  62.                 ATagParams =
  63.         }
  64.         # Current menu item is unlinked and marked too
  65.         10.2.CUR {
  66.                 wrapItemAndSub = <li id="current" class="minus">|</li>
  67.                 doNotLinkIt = 1
  68.                 allWrap = <span>|</span>
  69.         }
  70.         # If the menu item has subs add class plus to change icon
  71.         10.2.IFSUB {
  72.                 wrapItemAndSub = <li class="normal plus">|</li>
  73.         }
  74.         # Active items above current to be formatted differently as for first level
  75.         10.2.ACTIFSUB {
  76.                 wrapItemAndSub = <li class="active minus">|</li>
  77.         }
  78.         # Wrap the second level of the menu inside an unordered list
  79.         10.2.wrap = <ul class="cb-submenu">|</ul>
  80.        
  81.         10.3 = TMENU
  82.         10.3 {
  83.                 noBlur = 1
  84.                 CUR = 1
  85.                 IFSUB = 1
  86.                 ACTIFSUB = 1
  87.         }
  88.         # Same formatting of menu entries as list items.
  89.         10.3.NO {
  90.                 wrapItemAndSub = <li class="normal minus">|</li>
  91.                 ATagParams =
  92.         }
  93.         # Current menu item is unlinked and marked too
  94.         10.3.CUR {
  95.                 wrapItemAndSub = <li id="current" class="minus">|</li>
  96.                 doNotLinkIt = 1
  97.                 allWrap = <span>|</span>
  98.         }
  99.         # If the menu item has subs add class plus to change icon
  100.         10.3.IFSUB {
  101.                 wrapItemAndSub = <li class="normal plus">|</li>
  102.         }
  103.         # Active items above current to be formatted differently as for higher levels
  104.         10.3.ACTIFSUB {
  105.                 wrapItemAndSub = <li class="active minus">|</li>
  106.         }
  107.         # Wrap the third level of the menu inside an unordered list
  108.         10.3.wrap = <ul class="cb-subsubmenu">|</ul>
  109.        
  110.         # end of columnbox
  111.         11 < boxbottom
  112. }
  113. ## SubMenu [End]