How to mark active rubrique/article

Hello,

I'm working with SPIP for some Sites [1] - they are all german - and I have a problem and I thought about it, but I can't get any solution.
Well, for naviagtion I use a RUBRIQUE-Loop like this:

<BOUCLE_navigation(RUBRIQUES) {par titre}>
    <a href="'URL_RUBRIQUE">#TITRE</a>
</BOUCLE_navigation>

(very basic example)

How can I mark the active rubrique with an special class-tag or id-tag (important for CSS-use), so if I'm on the website of the Writings-Rubrique this rubrique is marked special:

<a href="rubrique1.html">About me</a>
<a href="rubrique2.html">Photos</a>
<a class="active" href="rubrique3.html">Writings</a>

Has anybody any idea, how this can be done?

Greetings from Germany
Heiko

[1] http://www.heiko-jansen.de
     http://www.latnrw.de
     http://www.lurch-theater.de/rw

--
Heiko Jansen, Bochum, Germany
e.mail[1]: heiko.jansen@rub.de
e.mail[2]: heiko@schaustall.de
web: http://www.heiko-jansen.de
ENCRYPT YOUR E-MAILS! VERSCHLÜSSELT EURE MAILS!
PGP-Key auf Anfrage oder auf der Webseite

@ Heiko Jansen <heiko.jansen@rub.de> :

<BOUCLE_navigation(RUBRIQUES) {par titre}>
   <a href="'URL_RUBRIQUE">#TITRE</a>
</BOUCLE_navigation>

(very basic example)

How can I mark the active rubrique with an special class-tag or id-tag
(important for CSS-use), so if I'm on the website of the
Writings-Rubrique this rubrique is marked special:

<a href="rubrique1.html">About me</a>
<a href="rubrique2.html">Photos</a>
<a class="active" href="rubrique3.html">Writings</a>

Has anybody any idea, how this can be done?

This is painful ; you have to use some php :

<?php $rub = #ID_RUBRIQUE; ?> (this is inside the main (ARTICLES){id_article} loop)
<BOUCLE_navigation(RUBRIQUES) {par titre}>
   <a<?php
    if ($rub == #ID_RUBRIQUE) echo " class=\"active\"";
?> href="#URL_RUBRIQUE">#TITRE</a>
</BOUCLE_navigation>

-- Fil

Hello,

Here is a workaround in PHP :

Before any loop :
<?php $rubrik = $id_rubrique ?>

and :

<BOUCLE_navigation(RUBRIQUES) {par titre}>
   <?php if ("#ID_RUBRIQUE" == $rubrik) { ?>
   code for the current rubric
   <?php } else { ?>
   code for other rubrics
   <?php } ?>
</BOUCLE_navigation>

Bernard Martin-Rabaud
martinrabo@wanadoo.fr

-----Message d'origine-----
De : spip-en-bounces@rezo.net [mailto:spip-en-bounces@rezo.net]De la
part de Heiko Jansen
Envoyé : dimanche 19 octobre 2003 22:36
À : spip-en@rezo.net
Objet : [Spip-en] How to mark active rubrique/article

Hello,

I'm working with SPIP for some Sites [1] - they are all german - and I
have a problem and I thought about it, but I can't get any solution.
Well, for naviagtion I use a RUBRIQUE-Loop like this:

<BOUCLE_navigation(RUBRIQUES) {par titre}>
    <a href="'URL_RUBRIQUE">#TITRE</a>
</BOUCLE_navigation>

(very basic example)

How can I mark the active rubrique with an special class-tag or id-tag
(important for CSS-use), so if I'm on the website of the
Writings-Rubrique this rubrique is marked special:

<a href="rubrique1.html">About me</a>
<a href="rubrique2.html">Photos</a>
<a class="active" href="rubrique3.html">Writings</a>

Has anybody any idea, how this can be done?

Greetings from Germany
Heiko

[1] http://www.heiko-jansen.de
     http://www.latnrw.de
     http://www.lurch-theater.de/rw

--
Heiko Jansen, Bochum, Germany
e.mail[1]: heiko.jansen@rub.de
e.mail[2]: heiko@schaustall.de
web: http://www.heiko-jansen.de
ENCRYPT YOUR E-MAILS! VERSCHLÜSSELT EURE MAILS!
PGP-Key auf Anfrage oder auf der Webseite

_______________________________________________
spip-en@rezo.net - http://listes.rezo.net/mailman/listinfo/spip-en