[Typo3] rtehtmlarea and bulletlist formatting

Christopher bedlamhotel at gmail.com
Wed Nov 30 17:02:30 CET 2005


Hi,

On 30/11/05, Patrick Rodacker <rod at biba.uni-bremen.de> wrote:
> Hi Christopher,
>
> as I wrote before 'the bullet image should be different depending on the
> page id'. We are working with different colors on the first menu level
> of the page and every bullet list within one branch should have images
> in this special color. Therefore the '<ul>' tag needs a class assigned
> using the pageid or a defined constant like the code I've posted:


Sorry, I managed not to read that in your first message. In any case,
if this is all you're needing to do, then your lists still do _not_
need any additional class or id attributes:

CSS:
==========
body#foo ul,
body#bar ul {
  list-style-type:none;
}

body#foo ul li,
body#bar ul li {
  padding-left:10px;
  background-position:3px 3px;
  background-color:transparent;
  background-repeat:no-repeat;
}

body#foo ul li {
  background-image:url(path/to/red/bullet.gif);
}

body#bar ul li {
  background-image:url(path/to/blue/bullet.gif);
}


HTML:
==========
<body id="foo">
...
...
<!-- This list has red bullets: -->
<ul>
<li>Lorrem</li>
<li>Ipsum</li>
<li>Dolor</li>
</ul>

or:

<body id="bar">
...
...
<!-- This list has blue bullets: -->
<ul>
<li>Lorrem</li>
<li>Ipsum</li>
<li>Dolor</li>
</ul>


As I alluded to in the last post, the _default_ state of elements
virtually never needs classes or ids; these should normally only be
used to style variants from the norm. Since you've said that "every
bullet list within one branch" will have the same properties, all you
need to do is identify a page as belonging to a given branch. You can
do this by giving the body element an id--which should be _relatively_
straightforward to do using conditions (probably PIDinRootline) [1],
and something like page.bodyTagCObject [2].

Assuming you've only got a finite number of top level objects,
something like this should work (say, for example, that the top level
page ids are 36, 64 and 72):

page.bodyTagCObject = HTML
page.bodyTagCObject {
  value = default
  wrap = <body id="|">
}

[PIDinRootine = 36]
page.bodyTagCObject.value = foo
[PIDinRootline = 64]
page.bodyTagCObject.value = bar
[PIDinRootline = 72]
page.bodyTagCObject.value = lorem
[global]

You could also, no doubt, use a CASE object or figure it out in
another way, but this should work for fixed numbers of top-level
pages.


-Christopher


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



More information about the TYPO3-english mailing list