forum.coppermine-gallery.net

Support => Français (French) => Language Specific Support => cpg1.5.x Français (French) => Topic started by: jessy1991 on March 08, 2011, 05:03:27 pm

Title: Modifier la balise "title" dans les albums
Post by: jessy1991 on March 08, 2011, 05:03:27 pm
Bonjour à tous ! :)

J'aimerai que dans tout mes albums, pouvoir rajouter dans la balise "title" Le mot "Photo :" sans avoir à le rajouter moi même sur TOUT les albums, de façon à avoir tout en haut de l'écran : Photo : {Nom_de_l_album}

Une idée ? Merci beaucoup ! :)
Title: Re: Modifier la balise "title" dans les albums
Post by: François Keller on March 08, 2011, 09:44:33 pm
Bonjour,

dans le fichier theme.php de votre theme, ajoutez la section ci-dessous si elle n'y est pas encore
Code: [Select]
/******************************************************************************
** Section <<<theme_page_title>>> - START
******************************************************************************/
// Creates the title tag for each page
// For the sake of search engine friendliness, the dynamic part $section should come first
function theme_page_title($section)
{
    global $CONFIG;
    $return = strip_tags(bb_decode($section)) . ' - ' . $CONFIG['gallery_name'];
    return $return;
}
/******************************************************************************
** Section <<<theme_page_title>>> - END
******************************************************************************/
Modifiez la en fonction de vos besoins, par exemple comme ceci
Code: [Select]
/******************************************************************************
** Section <<<theme_page_title>>> - START
******************************************************************************/
// Creates the title tag for each page
// For the sake of search engine friendliness, the dynamic part $section should come first
function theme_page_title($section)
{
    global $CONFIG;
    $return = "Photo: ".strip_tags(bb_decode($section)) . ' - ' . $CONFIG['gallery_name'];
    return $return;
}
/******************************************************************************
** Section <<<theme_page_title>>> - END
******************************************************************************/
mais dans cet exemple, le mot photos est ajouté à tous les titres, si vous ne voulez le mot photos que lorsque les albums sont affichés, il faut mettre une boucle de condition dans la fonction