Is there a component for Joomla that....

Discussion in 'Joomla' started by spondishy, Aug 14, 2006.

  1. #1
    Allows you to change the title tag on the page to whatever you want.

    At the moment the title tag is:

    Site Name - Page Name

    I'd rather have something bespoke. Any ideas?
     
    spondishy, Aug 14, 2006 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,821
    Likes Received:
    4,539
    Best Answers:
    123
    Trophy Points:
    665
    #2
    Just change your template so that the title is constructed according to your rules. Ignore that!

    It's actually set in some code in $mainframe which is defined in joomla.php or mambo.php depending on which one you're using.
    function setPageTitle( $title=null ) {
    	if (@$GLOBALS['mosConfig_pagetitles']) {
    		$title = trim( htmlspecialchars( $title ) );
    		$this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' - '. $title : $GLOBALS['mosConfig_sitename'];
    	}
    }
    
    Code (markup):
    So, you have some choices
    1. you can amend this function and remember to check it every time you upgrade
    2. you can write your own function that updates $mainframe->_head
    3. you can manually change $mainframe->_head every time
    I'd say #2 would be the best.
     
    sarahk, Aug 14, 2006 IP
  3. spondishy

    spondishy Peon

    Messages:
    735
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for the response Sarah. Appreciated.
     
    spondishy, Aug 14, 2006 IP