Home

Archive for July 17th, 2008

TypoLink: Tiny Helpers To Save The Day #1

Thursday, July 17th, 2008 | Author: Benni

I more and more enjoy the power of TypoScript. Every day, I learn something new. I will

Tip 1: You want to link to the same page, but with JS params etc,

lib.mytext = TEXT
lib.mytext.value = This is a link
lib.mytext.typolink.parameter = {TSFE:id},775 500x600 selflink
lib.mytext.typolink.parameter.insertData = 1

I had to use this idea when having a big site with a lot of microsites where the client is able to clone a microsite without needing to configure any IDs. The typolink.parameter = this,775.. did not work.

Basically, with this project, I had to make sure that no page IDs were hardcoded in TypoScript, so it was easy to create a new site inside TYPO3.

The following example renders a menu based on keywords (there was a requirement about the page titles) instead of a special = directory type of menu.

lib.rightnav = HMENU
lib.rightnav {
  special = keywords
  special {
    value = 1
    depth = 2
    setKeywords = Contact,Newsletter
    keywordsField = title
    entryLevel = 0
  }
  1 = TMENU
  1 {
    alternativeSortingField = sorting
    noBlur = 1
    NO.allWrap = <li>|</li>
    wrap = <ul class="rightcol_contact">|</ul>
  }
}

The next example shows a tt_news to link to the first subpage as the “single page”.

plugin.tt_news.singlePid.cObject = HMENU
plugin.tt_news.singlePid.cObject {
	special = directory
	special.value.data = TSFE:id
	maxItems = 1
	includeNotInMenu = 1
	1 = TMENU
	1 {
		NO.doNotLinkIt = 1
		NO.stdWrap.field = uid
	}
}

I know it’s not big magic and can be solved differently as well, but it just keeps me busy these days :)

Category: TYPO3 | 2 Comments