[Typo3] Alias for the BODY as the value for the id of the page

Christopher bedlamhotel at gmail.com
Thu Sep 22 18:32:18 CEST 2005


Hi,

On 22/09/05, tapio <tapio.markula at dnainternet.net> wrote:
> Hi
>
> how to set as the value of the id attribute for BODY the name alias?
>
> for example http://www.mysite.com/this_page/
>
> could have
> <body id="this_page">
>
> I would need sometimes special CSS for some pages.
>
> this doesn't work
>
> page.bodyTag=<body id="alias_{field:alias}">

No, and there's no reason why you should expect it to (hint: look at
the data type for the 'page.bodyTag' object in the TSref [1] and then
follow up in the Datatype reference in the TSref [2]).

> (avoiding empty id value some prefix would be desirable - endeed
> I recommend always to set alias for every page)

Why add cruft that you're not going to use to the page record? Why not
just set the field only when you need it and make the contents of the
opening body tag dependent on whether or not there is a value set for
the alias field? It should be simple enough with
"page.bodyTagCObject"...

> page.bodyTag=<body id="{$alias}">
> can be set *manual way* own id value but not *automatic*.

No way is going to be automatic, unless you're somehow generating the
css selectors in the stylesheet anyway...

-Christopher

[1] http://typo3.org/documentation/document-library/doc_core_tsref/quot_PAGE_quot/
[2] http://typo3.org/documentation/document-library/doc_core_tsref/Datatype_reference/



More information about the TYPO3-english mailing list