[TYPO3] TSFE.constants in Typo3 ver. 4.1.5

Christopher Torgalson bedlamhotel at gmail.com
Sun Jan 6 19:40:50 CET 2008


Hi,

On Jan 6, 2008 6:57 PM, Anders Kongsted <typo3 at kongsted.dk> wrote:
> Hi,
>
> Greate someone is awake.... :)
>
> But even with the correction, it doesn't work. All my menu options is
> still black... :(
>
> //Anders Kongsted
>
> Dmitry Dulepov [typo3] skrev:
> > Ji!
> >
> > Anders Kongsted wrote:
> >
> >> I can't get TSFE.constants to work.
> >> On one of my pages I have in my TS:
> >>
> >> TSFE.constants.websiteConfig.siteColor = #119911
> >>
> >
> > Side note for other readers: this is in TSConfig.
> >
> >
> >> And in my template I have:
> >>
> > ...
> >
> >>      backColor = ${websiteConfig.siteColor}
> >>
> > ...
> >
> >> But the color doesn't change - it's black (#000000).
> >>
> >> Any solutions? :)
> >>
> >
> > According to docs correct syntax is:
> >
> > backColor = {$websiteConfig.siteColor}


A number of problems:

1. Incorrect syntax in the TS template

[as noted by Dmitri]


2. Declaration does not match call

[i.e. "TSFE.constants.websiteConfig.siteColor" is different from
"websiteConfig.siteColor"--it should NOT be different; if you check
the TSref, you'll see that constants are replaced by simple
str_replace (1), so if one is different from the other, no replacement
can occur]


3. You appear to have entered some part of your TS in the wrong field!

[Quoting: "Side note for other readers: this is in TSConfig." This is
wrong. TS constant declarations belong in the "Constants" field of the
TEMPLATE record, not in the TSconfig field of the page or user record.
Similarly, your actual TS objects belong in the "Setup" field of the
template record]


-- 
Christopher Torgalson
http://www.typo3apprentice.com/

(1) http://typo3.org/documentation/document-library/references/doc_core_tsref/4.1.0/view/6/1/#id3582177


More information about the TYPO3-english mailing list