Module : texte variable dans un block en fonction de la page

Bonjour,

je voudrais savoir s’il existe un module (ou un code php) qui me permette d’afficher dans un bloc, un texte en fonction de l’url de la page, et qui prenne en compte le joker (un peu comme les droits d’accès des bloc). Le nombre de messages différents ne serait pas très important (un dizaine tout au plus).

merci pour votre aide.

#

C’est pas super élégant, mais pourquoi ne pas afficher un bloc par texte, en utilisant la fonction «afficher uniquement sur les pages XXX» pour chaque bloc ?

Vincent

Formations Drupal pour WEBMASTERS, DESIGNERS et DÉVELOPPEURS.

#

C’est plus élégant :

<?php
$helps
= array(

=> array ('url' => "<em>",
'text' => t("Ici c'est l'accueil")),

=> array ('url' => "blog/</em>",
'text' => t("Mon blog")),

=> array ('url' => "annuaire/<em>",
'text' => t("Annuaire")),

=> array ('url' => "node/</em>",
'text' => t("Ici c'est le contenu")),

=> array ('url' => "admin/<em>",
'text' => t("Espace administration")),

);

foreach ($helps as $help){
         
$path = drupal_get_path_alias($_GET['q']);
         
$regexp = '/^('. preg_replace(array('/(\r\n?|\n)/', '/\\*/', '/(^||)\\<front\\>($||)/'), array('|', '.</em>', '\1'. preg_quote(variable_get('site_frontpage', 'node'), '/') .'\2'), preg_quote($help['url'], '/')) .')$/';
         
// Compare with the internal and path alias (if any).
         
$page_match = preg_match($regexp, $path);
          if (
$path != $_GET['q']) {
           
$page_match = $page_match || preg_match($regexp, $_GET['q']);
          }
if (
$page_match == TRUE) {$message = $help['text'];}
}
print
$message;
?>

Syndiquer le contenu