TSFE.constants in Typo3 ver. 4.1.5

View: New views
15 Messages — Rating Filter:   Alert me  

TSFE.constants in Typo3 ver. 4.1.5

by Anders Kongsted :: Rate this Message:

| View Threaded | Show Only this Message

Hi,

I can't get TSFE.constants to work.
On one of my pages I have in my TS:

TSFE.constants.websiteConfig.siteColor = #119911

And in my template I have:

temp.menu1 = HMENU
temp.menu1 {
  1 = GMENU
  1 {
    NO = 1
    NO {
      wrap = <td> | </td>
      backColor = ${websiteConfig.siteColor}
      ...
    }
}

But the color doesn't change - it's black (#000000).

Any solutions? :)

Regards
Anders Kongsted


_______________________________________________
TYPO3-english mailing list
TYPO3-english@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english

Re: TSFE.constants in Typo3 ver. 4.1.5

by Dmitry Dulepov [typo3] :: Rate this Message:

| View Threaded | Show Only this Message

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}

--
Dmitry Dulepov
TYPO3 core team
Web: http://typo3bloke.net/
Skype: callto:liels_bugs
"Nothing is impossible. There are only limits to our knowledge"
_______________________________________________
TYPO3-english mailing list
TYPO3-english@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english

Re: TSFE.constants in Typo3 ver. 4.1.5

by Anders Kongsted :: Rate this Message:

| View Threaded | Show Only this Message

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}
>
>  

_______________________________________________
TYPO3-english mailing list
TYPO3-english@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english

Re: TSFE.constants in Typo3 ver. 4.1.5

by Christopher Torgalson :: Rate this Message:

| View Threaded | Show Only this Message

Hi,

On Jan 6, 2008 6:57 PM, Anders Kongsted <typo3@...> 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
_______________________________________________
TYPO3-english mailing list
TYPO3-english@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english

Re: TSFE.constants in Typo3 ver. 4.1.5

by Anders Kongsted :: Rate this Message:

| View Threaded | Show Only this Message

Hi Christopher,

I have the code from here:
http://typo3.org/documentation/document-library/references/doc_core_tsconfig/4.0.0/view/1/3/#id2800466

If I read the description for "constants", I can't see your point in our
second reply? Or i'm I wrong? If so, please send a link, where I can
read some more... :)

//Anders Kongsted

Christopher Torgalson skrev:

> Hi,
>
> On Jan 6, 2008 6:57 PM, Anders Kongsted <typo3@...> 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]
>
>
>  

_______________________________________________
TYPO3-english mailing list
TYPO3-english@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english

Re: TSFE.constants in Typo3 ver. 4.1.5

by Dmitry Dulepov [typo3] :: Rate this Message:

| View Threaded | Show Only this Message

Hi!

Christopher Torgalson wrote:
> 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.

Please, take a look into TSConfig document first, specifically at the {link below + 1 page down in the browser}:
http://typo3.org/documentation/document-library/references/doc_core_tsconfig/4.1.0/view/1/3/#id3546072

--
Dmitry Dulepov
TYPO3 core team
Web: http://typo3bloke.net/
Skype: callto:liels_bugs
"Nothing is impossible. There are only limits to our knowledge"
_______________________________________________
TYPO3-english mailing list
TYPO3-english@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english

Re: TSFE.constants in Typo3 ver. 4.1.5

by Christopher Torgalson :: Rate this Message:

| View Threaded | Show Only this Message

Hi,

On Jan 6, 2008 8:13 PM, Anders Kongsted <typo3@...> wrote:
> Hi Christopher,
>
> I have the code from here:
> http://typo3.org/documentation/document-library/references/doc_core_tsconfig/4.0.0/view/1/3/#id2800466
>
> If I read the description for "constants", I can't see your point in our
> second reply? Or i'm I wrong? If so, please send a link, where I can
> read some more... :)


Right. I haven't read that bit of the TSconfig doc for a long while as
you can probably tell. In any case, a few minutes' testing leads me to
suspect that your problem might be with your GMENU--that is, if your
constants are set up as you've described. Either way, you need to
check your code over in detail--what you've given here does seem to be
right.

This TS code in the template (borrowed from the TS by Example manual):


page.1000 = HMENU
page.1000.1 = GMENU
page.1000.1.NO {
  XY = [10.w],[10.h]
  backColor = {$websiteConfig.id}
  10 = TEXT
  10.text.field = title
  10.offset = 0,7
}


And this code in the TSconfig field of the root page record:


TSFE.constants.websiteConfig.id = #ff9900


Yields the expected result: a GMENU with a garish orange background :-)


--
Christopher Torgalson
http://www.typo3apprentice.com/
_______________________________________________
TYPO3-english mailing list
TYPO3-english@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english

Re: TSFE.constants in Typo3 ver. 4.1.5

by Christopher Torgalson :: Rate this Message:

| View Threaded | Show Only this Message

On Jan 6, 2008 9:31 PM, Dmitry Dulepov [typo3] <dmitry@...> wrote:

> Hi!
>
> Christopher Torgalson wrote:
> > 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.
>
> Please, take a look into TSConfig document first, specifically at the {link below + 1 page down in the browser}:
> http://typo3.org/documentation/document-library/references/doc_core_tsconfig/4.1.0/view/1/3/#id3546072


Already corrected my earlier mistake. It seems the whole TSconfig
document does not fit in my head :)


--
Christopher Torgalson
http://www.typo3apprentice.com/
_______________________________________________
TYPO3-english mailing list
TYPO3-english@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english

Re: TSFE.constants in Typo3 ver. 4.1.5

by Anders Kongsted :: Rate this Message:

| View Threaded | Show Only this Message

Christopher Torgalson skrev:

> Right. I haven't read that bit of the TSconfig doc for a long while as
> you can probably tell. In any case, a few minutes' testing leads me to
> suspect that your problem might be with your GMENU--that is, if your
> constants are set up as you've described. Either way, you need to
> check your code over in detail--what you've given here does seem to be
> right.
>
> This TS code in the template (borrowed from the TS by Example manual):
>
>
> page.1000 = HMENU
> page.1000.1 = GMENU
> page.1000.1.NO {
>   XY = [10.w],[10.h]
>   backColor = {$websiteConfig.id}
>   10 = TEXT
>   10.text.field = title
>   10.offset = 0,7
> }
>
>
> And this code in the TSconfig field of the root page record:
>
>
> TSFE.constants.websiteConfig.id = #ff9900
>
>
> Yields the expected result: a GMENU with a garish orange background :-)
>  
It's exactly what I have done.

Template - setup:

temp.menu1 = HMENU
temp.menu1 {
1 = GMENU
1 {
NO = 1
NO {
wrap = <td> | </td>
backColor = {$websiteConfig.id}
XY = 150,20

...

TSconfig:
TSFE.constants.websiteConfig.id = #aa0099

I tried to change siteColor to id - just to try something.... :)

But..... No.... It doesn't work.... :(

I had read an email on the list, with another person who had the same
problem after an upgrade from 3.X to 4.X.... Could it be the same
problem? A little unwanted feature (also known as a bug)? :)

//Anders

_______________________________________________
TYPO3-english mailing list
TYPO3-english@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english

Re: TSFE.constants in Typo3 ver. 4.1.5

by Christopher Torgalson :: Rate this Message:

| View Threaded | Show Only this Message

Hi,

On Jan 6, 2008 10:15 PM, Anders Kongsted <typo3@...> wrote:

> Christopher Torgalson skrev:
> > Right. I haven't read that bit of the TSconfig doc for a long while as
> > you can probably tell. In any case, a few minutes' testing leads me to
> > suspect that your problem might be with your GMENU--that is, if your
> > constants are set up as you've described. Either way, you need to
> > check your code over in detail--what you've given here does seem to be
> > right.
> >
> > This TS code in the template (borrowed from the TS by Example manual):
> >
> >
> > page.1000 = HMENU
> > page.1000.1 = GMENU
> > page.1000.1.NO {
> >   XY = [10.w],[10.h]
> >   backColor = {$websiteConfig.id}
> >   10 = TEXT
> >   10.text.field = title
> >   10.offset = 0,7
> > }
> >
> >
> > And this code in the TSconfig field of the root page record:
> >
> >
> > TSFE.constants.websiteConfig.id = #ff9900
> >
> >
> > Yields the expected result: a GMENU with a garish orange background :-)
> >
> It's exactly what I have done.
>

<snip>

>
> I tried to change siteColor to id - just to try something.... :)
>
> But..... No.... It doesn't work.... :(
>
> I had read an email on the list, with another person who had the same
> problem after an upgrade from 3.X to 4.X.... Could it be the same
> problem? A little unwanted feature (also known as a bug)? :)


Unlikely such a bug would have survived so long into the 4.x series
with few references.

Questions for you:

1. Does your GMENU work when you use the literal hex value instead of
the constant?

2. Does the expected value show up in the TS Object Browser when
you've got the "Constants display" option set to "Plain substitution"
or "Substituted constants in green"?

3. Does anything change if you use "lib.menu1" instead of
"temp.menu1"? (*If* there is a difference when you do this though, I'd
expect it to be output -vs- no output)

--
Christopher Torgalson
http://www.typo3apprentice.com/
_______________________________________________
TYPO3-english mailing list
TYPO3-english@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english

Re: TSFE.constants in Typo3 ver. 4.1.5

by Anders Kongsted :: Rate this Message:

| View Threaded | Show Only this Message

Hi,

Christopher Torgalson skrev:

> Hi,
>
> Unlikely such a bug would have survived so long into the 4.x series
> with few references.
>
> Questions for you:
>
> 1. Does your GMENU work when you use the literal hex value instead of
> the constant?
>
> 2. Does the expected value show up in the TS Object Browser when
> you've got the "Constants display" option set to "Plain substitution"
> or "Substituted constants in green"?
>
> 3. Does anything change if you use "lib.menu1" instead of
> "temp.menu1"? (*If* there is a difference when you do this though, I'd
> expect it to be output -vs- no output)

1: Yes. If I use the following code, I get a dark blue bg.

temp.menu1 = HMENU
temp.menu1 {
  1 = GMENU
  1 {
    NO = 1  
    NO {
      wrap = <td> | </td>
      backColor = #123456
      XY = 150,20
...

2: I got the following in my page TS Obj. Browser.

[TSFE]
[constants]
[siteColor]=*#FF0000*
[websiteConfig]
[id]=*#aa0099*

And I can also get this from the obj. browser:
   
 
Welcome

TSFE.constants.websiteConfig.id = #aa0099



 From my template TS obj. browser I can only see:
       
*CONSTANTS ROOT*

       
[siteColor]=*#FF0000*


That one I can use, but that settings is from the root of the website,
and I need individual colors. I had tried to insert
"TSFE.constants.siteColor = #987654" in the page TSconfig, but it doen't
make any changes. :(

3: No changes.... :/

//Anders

_______________________________________________
TYPO3-english mailing list
TYPO3-english@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english

Re: TSFE.constants in Typo3 ver. 4.1.5

by Christopher Torgalson :: Rate this Message:

| View Threaded | Show Only this Message

Hi,

On Jan 7, 2008 12:14 AM, Anders Kongsted <typo3@...> wrote:
> Hi,

<snip>

> That one I can use, but that settings is from the root of the website,
> and I need individual colors. I had tried to insert
> "TSFE.constants.siteColor = #987654" in the page TSconfig, but it doen't
> make any changes. :(

<snip>

Wait: do you mean you're trying to vary the colour for individual
pages by placing different values in various pages' TSconfig fields?
If so, then this may apply:

"Notice: In the frontend the setting of default constants will only
apply to a branch of the tree if a template record is found on that
page (or if a template record is set for "next level"). In other
words: If you want the Page TSconfig constant defaults to affect only
a certain branch of the page tree, make sure to create a template
record (a blank one will do) on the page that carries the Page
TSconfig information."

(From the TSconfig page you linked to earlier)


--
Christopher Torgalson
http://www.typo3apprentice.com/
_______________________________________________
TYPO3-english mailing list
TYPO3-english@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english

Re: TSFE.constants in Typo3 ver. 4.1.5

by Dmitry Dulepov [typo3] :: Rate this Message:

| View Threaded | Show Only this Message

Hi!

Christopher Torgalson wrote:
> Already corrected my earlier mistake. It seems the whole TSconfig
> document does not fit in my head :)

Same for me ;) Always found it hard to memorize.

--
Dmitry Dulepov
TYPO3 core team
Web: http://typo3bloke.net/
Skype: callto:liels_bugs
"Nothing is impossible. There are only limits to our knowledge"
_______________________________________________
TYPO3-english mailing list
TYPO3-english@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english

Re: TSFE.constants in Typo3 ver. 4.1.5

by Anders Kongsted :: Rate this Message:

| View Threaded | Show Only this Message

Christopher Torgalson skrev:

> Wait: do you mean you're trying to vary the colour for individual
> pages by placing different values in various pages' TSconfig fields?
> If so, then this may apply:
>
> "Notice: In the frontend the setting of default constants will only
> apply to a branch of the tree if a template record is found on that
> page (or if a template record is set for "next level"). In other
> words: If you want the Page TSconfig constant defaults to affect only
> a certain branch of the page tree, make sure to create a template
> record (a blank one will do) on the page that carries the Page
> TSconfig information."
>
> (From the TSconfig page you linked to earlier)
Okay. I see the problem.
I have now created some template extension, and it change the colors.

Is there an easy way to change the color on each page, AND have
different colors on each menu options?

Menu 1 - blue menu options, and blue theme.
Menu 2 - red menu options, and red theme.
Menu 3 - green menu option, and green theme.

Or is the only way to do it with template extension to the page-color,
and optionsSplit to the menu-color?

Regard
Anders Kongsted

_______________________________________________
TYPO3-english mailing list
TYPO3-english@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english

Re: TSFE.constants in Typo3 ver. 4.1.5

by Christopher Torgalson :: Rate this Message:

| View Threaded | Show Only this Message

Hi,

On Jan 7, 2008 7:48 PM, Anders Kongsted <typo3@...> wrote:

> Christopher Torgalson skrev:
> > Wait: do you mean you're trying to vary the colour for individual
> > pages by placing different values in various pages' TSconfig fields?
> > If so, then this may apply:
> >
> > "Notice: In the frontend the setting of default constants will only
> > apply to a branch of the tree if a template record is found on that
> > page (or if a template record is set for "next level"). In other
> > words: If you want the Page TSconfig constant defaults to affect only
> > a certain branch of the page tree, make sure to create a template
> > record (a blank one will do) on the page that carries the Page
> > TSconfig information."
> >
> > (From the TSconfig page you linked to earlier)
> Okay. I see the problem.
> I have now created some template extension, and it change the colors.
>
> Is there an easy way to change the color on each page, AND have
> different colors on each menu options?
>
> Menu 1 - blue menu options, and blue theme.
> Menu 2 - red menu options, and red theme.
> Menu 3 - green menu option, and green theme.
>
> Or is the only way to do it with template extension to the page-color,
> and optionsSplit to the menu-color?


I can't make sense of what you're trying to do from this description.
Post a graphic somewhere or post some sample html code. Between
TYPO3's constants, conditions, and optionsplit (to say nothing of CSS
etc), it shouldn't be too difficult...




--
Christopher Torgalson
http://www.typo3apprentice.com/
_______________________________________________
TYPO3-english mailing list
TYPO3-english@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english