
Afficher les résumés de Drupal dans un faux fieldset
Création: 29 mars 2009 à 14:32 | Dernière modification: 30 octobre 2009 à 17:54
Catégorie:
Dans le fichier node.tpl.php, section <div class="content">...</div>:
<div class="content">
<?php if ($teaser): ?>
<p class="legende"><span>Résumé de la page</span></p>
<div class="content-apres-legende">
<?php endif;?>
<?php echo $content; ?>
<?php if ($teaser): ?>
<p class="content-apres-legende-plus"><em>En lire plus sur </em><a href="<?php echo $node_url; ?>"><?php echo $title; ?></a><em>...</em></p>
</div>
<?php endif; ?>
</div>
Comme CSS:
/* Affichage des résumés, version fieldset */
div.node-teaser div.content {
margin-top: 1.5em;
border: 1px solid #eee;
}
div.node-teaser div.content p.legende {
margin-top: -0.8em;
margin-left: 10px;
margin-bottom: 0;
padding-bottom: 0;
float: left;
color: #004455;
}
div.node-teaser div.content p.legende span
{
padding: 0px 10px;
background-color: #fff;
font-weight: bold;
}
div.node-teaser div.content div.content-apres-legende {
clear: left;
padding: 0 10px 10px 10px;
}
div.node-teaser div.content div.content-apres-legende p.content-apres-legende-plus {
margin-top: 10px;
margin-bottom: 0;
padding-top: 5px;
border-top: 1px solid #eee;
text-align: right;
}
Publier un nouveau commentaire