1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Docs] About the Title Tags

Discussion in 'Design and Layout' started by Nick, Aug 1, 2009.

  1. Nick

    Nick Well-Known Member

    The title that displays at the top of your browser is determined by the getTitle function called from the header.php in your theme:

    PHP:
    <title><?php echo $h->getTitle(); ?></title>

    1.
    If $hotaru->pageTitle is not empty, show it and append the site name, e.g.

    Man wins the lottery << Hotaru CMS (post title)
    Activities << Hotaru CMS (category name)
    Bingo << Hotaru CMS (tag)

    2. If the page name is not equal to "index", make it look pretty and append the site title, e.g.

    Profile << Hotaru CMS
    Page Settings << Hotaru CMS

    Customizing title tags

    If you'd like to change how titles are displayed, there are two parameters you can pass to the getTitle function:

    PHP:
    $h->getTitle(' &raquo; '); // replaces the default delimiter (&laquo)
    $h->getTitle(''true); // enables "raw" mode which returns ONLY the title with no site name attached

    $h->getTitle(' - 'true// example using both paramters
    Note to plugin developers: Instead of hard-coding delimiters into your page titles, use the text [delimiter]. The getTitle function will replace that text with the user's choice of delimiter.
     
    Last edited: Jan 8, 2010

Share This Page