[Typo3] Alter rendering of tt_content headings
Christopher
tombedlam at yahoo.com
Wed Apr 20 06:56:28 CEST 2005
Hi,
--- Gwilym Evans <gwilym at redd.com.au> wrote:
> I've been experimenting a little, a reading a lot of the tsref, but just
> can't get my head around it all yet. What I'm trying to achieve is
> fairly simple in terms of HTML and CSS; div/positioned-based shadowed
> headings. But it requires a double-up on the rendering of the heading
> text itself.
>
> Currently I see the heading text being rendered as (simplified):
> <div><h1>{Heading Text}</h1></div>
>
> I need to somehow alter the TS being included so that headings in this
> template are rendered as such:
> <div>{Heading Text}<h1>{Heading Text}</h1></div>
>
> I can see that it'd be possible, I'm able to alter portions of the
> included TS libraries to change what's wrapped outside the heading text,
> but I can't for the life of me figure out how to output the heading text
> twice.
>
> List contributers, as usual your help is always appreciated.
>
You should have a go at the TS By Example document, it's a good starter for
TS rendering. However, what you need is probably something like this [ from
memory, so a) sorry if there are mistakes, and b) yes it *is* possible to
learn TS :D ]
lib.myHeader = COA
lib.myHeader {
5 = HTML
5.value.data = page:title
5.value.wrap = <!-- First div --><div>|</div>
10 = HTML
10.value.data = page:title
10.value.wrap = <!-- Second div --><div>|</div>
}
lib.stdheader (which is what you'll probably end up modifying when dealing
with headers) probably uses the TS property .insertData, if I remember
right, but this is not a major difference in the overall approach. For the
differences between .insertData and the .data stdWrap property, consult the
TSref section on 'datatypes'.
-Christopher
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the TYPO3-english
mailing list