[TYPO3-english] include TypoScript according to type (tt_news, tt_content)

Loek Hilgersom loek at netcoop.nl
Sun May 11 21:56:02 CEST 2014


Hey Robert,

You'll need an extra query to achieve that, unless you'll be able to access the 
data from the news records from some place where it's already been retrieved.
If that's done in TypoScript then you can store the values in a register to 
avoid the extra query.

With the query it will be something like this:

	10 = CASE
	10 {
		//key.data = register:tt_news_type

		key.cObject = RECORDS
		key.cObject {
			tables = tt_news
			dontCheckPid = 1
			source.data = register:tt_news_uid
			conf.tt_news = TEXT
			conf.tt_news.field = type
		}

		default = TEXT
		default.value = DEFAULT
		3 = TEXT
		3.value = THREE
		4 = TEXT
		4.value = FOUR
	}

Is this what you're after?

Hth, and greetings!
Loek


On 11-05-14 14:19, Robert Wildling wrote:
> Hi,
>
> I create several new content types (in tt_news at thte moment) via
> ext_tables.php like this:
>
> // add the new type
> $TCA['tt_news']['columns']['type']['config']['items'][] = Array('New Page Type',4);
>
> Each of those page types needs a little bit of additional TypoScript for
> selecting its own template file and activating some generic markers. The editors
> shall have the possibiliy to just choose the page type, and everything should
> work out-of-the-box (so no need to implement an additional TypoScript file
> manually).
>
> Is there a way to activate the specific TypoScript according to tt_news type?
> Something like
> [globalVar = GP:tt_news|type=4]
> [...]
>
> "Type" is neither a get nor post var... any other way to implement that
> functionality?
>
> Thanks for your tipps!
> Robert


More information about the TYPO3-english mailing list