Joomla!
http://forum.joomla.org/

order of items in generated tag</span><br /><span class="gensmall"><a href="http://forum.joomla.org/viewtopic.php?f=32&t=3849">http://forum.joomla.org/viewtopic.php?f=32&t=3849</a></span></td> <td align="right" valign="bottom"><span class="gensmall">Page <strong>1</strong> of <strong>1</strong></span></td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>freeman</b> [ Mon Sep 05, 2005 4:02 pm ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" />hi there.<br /><br />the standard generation of the title-tag is as follows:<br /><br /><title>GLOBAL SITE TITLE - CONTENT ITEM NAME/TITLE

i want it:

CONTENT ITEM NAME/TITLE - GLOBAL SITE TITLE

souldn't be too hard.
i searched in mambo.php but didn't find the right place...

fun, anyone?

;o)

Author:  stingrey [ Mon Sep 05, 2005 4:38 pm ]
Post subject:  Re: order of items in generated tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" />/includes/mambo.php<br /><br />Line 245<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">   function setPageTitle( $title=null ) {<br />       if (@$GLOBALS['mosConfig_pagetitles']) {<br />          $title = trim( htmlspecialchars( $title ) );<br />         $this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' - '. $title : $GLOBALS['mosConfig_sitename'];<br />      }<br />   }</div><br /><br /><em>This is for Mambo 4.5.2.3</em> </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>freeman</b> [ Mon Sep 05, 2005 4:53 pm ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" />thanks stingrey,<br /><br />i found exactly the same lines, but: what and how to change?<br /><br />thanks for your patience.<br />Norman </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>stingrey</b> [ Mon Sep 05, 2005 5:30 pm ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" />Replace with<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">   function setPageTitle( $title=null ) {<br />       if (@$GLOBALS['mosConfig_pagetitles']) {<br />          $title = trim( htmlspecialchars( $title ) );<br />         $this->_head['title'] = $title ? $title . ' - ' . $GLOBALS['mosConfig_sitename'] : $GLOBALS['mosConfig_sitename'];<br />      }<br />   }</div><br /><br /><br /><span style="color: red"><strong>Please backup this file before modifying!</strong></span> </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>freeman</b> [ Mon Sep 05, 2005 5:33 pm ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>following error...</b></td> </tr> <tr> <td colspan="2"><hr class="sep" />Thanks a lot,<br />but I still get an error:<br /><br /><br />DELETED*****<br /><br /><br />SORRY!  I was wrong. IT WORKS!<br /><br />Thanks!<br /><br />Norman </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>diilbert</b> [ Thu Sep 15, 2005 2:47 pm ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" />Thanks.  Was exactly what I was looking for  <img src="./images/smilies/wink.gif" alt=";)" title="Wink" /> </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>pli</b> [ Thu Nov 10, 2005 10:05 am ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" /><div class="quotetitle">stingrey wrote:</div><div class="quotecontent">Replace with<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">   function setPageTitle( $title=null ) {<br />       if (@$GLOBALS['mosConfig_pagetitles']) {<br />          $title = trim( htmlspecialchars( $title ) );<br />         $this->_head['title'] = $title ? $title . ' - ' . $GLOBALS['mosConfig_sitename'] : $GLOBALS['mosConfig_sitename'];<br />      }<br />   }</div><br /><br /><br /><span style="color: red"><strong>Please backup this file before modifying!</strong></span><br /></div><br /><br />This is excellent stingrey - thank you.<br /><br />Is there a way of deleting the word "Home" in the landing page title?<br />i.e. Home appears to be the default Component [ FrontPage ] in the menu. Could you remove it from that page title (without turning off Dynamic Page Titles) and still see Home in the menu?<br /><br />cheers<br />Peter </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>¥</b> [ Sat Nov 12, 2005 2:21 am ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" />Hi, for those wishing to remove the Site Name from the title altogether:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">   <br />function setPageTitle( $title=null ) {<br />       if (@$GLOBALS['mosConfig_pagetitles']) {<br />          $title = trim( htmlspecialchars( $title ) );<br />         $this->_head['title'] = $title;<br />      }<br />}<br /></div><br /><br />It seems logical and has worked so far on my site - but please let me know if it might cause an error. </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>¥</b> [ Thu Nov 17, 2005 5:09 am ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" />Hi - this method seems to work extremely well, except in cases of menu items pointing to Section and Category blogs.<br /><br />In those cases, Joomla ignores the page title prescribed in parameters and uses the name given to the menu item.<br /><br />For SEO purposes, this isn't very helpful - as navigation menu titles are extremely short, while SEO'd <title>'s are long and descriptive.<br /><br />Thanks very much for any help/advice. </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>brad</b> [ Mon Nov 21, 2005 12:35 am ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" />Have you tried a 3rd party sef component? opensef, 404sef ??<br /><br />It might give you more control. </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>¥</b> [ Mon Nov 21, 2005 1:13 am ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" />Using OpenSEF - also, the system works perfectly for normal pages - pulling the <title> tags from the parameters as provided.<br /><br />The only problem, and the huge problem - is with section and category blogs. These can only be created from within the menu system - and in these cases, Joomla is somehow using the name given to the menu:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">function setPageTitle( $title=null ) {<br />       if (@$GLOBALS['mosConfig_pagetitles']) {<br />          $title = trim( htmlspecialchars( $title ) );<br />         $this->_head['title'] = $title;<br />      }<br />}</div><br /><br />rather than the title provided in the parameters. It's basically substituting the name given the menu item (Home, for instance) for the actual page title. I'm hoping there's some way to get around this?<br /><br />At any rate, I don't think anything other than a core hack could modify this situation? For whatever reason, Joomla is incorrectly substituting the name given to the menu item and ignoring the title provided within the parameters. Given this code is created via includes/joomla.php, I don't think any of the SEF components can exert any additional controls over this? </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>¥</b> [ Mon Nov 21, 2005 1:29 am ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" />I also tried implementing a different menu system - the extended menu module - and had the same results. </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>compass</b> [ Mon Nov 21, 2005 1:58 am ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" />Have you tried openSEF, it allows fine control of titles/URL's etc.<br /><br />I think I have mine set up as:<br /><br />URL: comes from title alias<br />Page Title: comes from article title<br /><br />Though I haven't got round to it, I am just going to copy my template, modify the meta tags slightly and use that modified template for my home page... I hate hacking... </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>¥</b> [ Mon Nov 21, 2005 2:21 am ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" />Let me know if I'm wrong here - <br /><br />But Joomla now uses mosShowHeader to generate all header information - <br /><br />The page title tags (not SEF URLs) are then generated by includes/joomla.php, as specified in this thread.<br /><br />The problem is that in creating sections and blog categories, which can only be generated through the menu system - Joomla ignores the title tag set in the parameters for these blogs and substitutes the name given to the menu item.<br /><br />I believe I need to hack the code that is causing this situation so that the the $title variable is set by the title stipulated in the parameters rather than the default, which is apparently to pull the page title from the text prescribed within the menu. </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>lexi</b> [ Mon Dec 12, 2005 4:09 pm ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" />I have many different Link Categories. No matter where I go, the title says:  "web links"<br />I have 404 sef installed.<br />If I add a new Weblink Category I DO NOT have the following options:<br /><br /><br />SEO Title: Enter here the text to be used in the Title tag of the page. If left blank the Name of the Menu Item as entered in the Details part of this screen will be used instead.<br /><br />Meta Keyword: Enter here the Meta keywords to be used for the page.<br /><br />Meta Description: Enter here the Meta Description to be used for the page.<br /><br /><br /><!-- m --><a class="postlink" href="http://forum.joomla.org/index.php/topic,24178.0.html">http://forum.joomla.org/index.php/topic,24178.0.html</a><!-- m --><br /><br />So does anyone know what's wrong here? </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>panter011</b> [ Sat Feb 04, 2006 10:02 am ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" />This hack will help you have your site's title change on every page, displaying the title of the news or any content's title displayed.<br /><br /><a href="http://www.javieryep.com/site1002/content/view/51/29/" class="postlink">http://www.javieryep.com/site1002/content/view/51/29/</a><br /><br />hope it helps </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>Tim777</b> [ Sat Mar 25, 2006 3:54 pm ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" /><div class="quotetitle"><b>Quote:</b></div><div class="quotecontent">Is there a way of deleting the word "Home" in the landing page title?<br />i.e. Home appears to be the default Component [ FrontPage ] in the menu. Could you remove it from that page title (without turning off Dynamic Page Titles) and still see Home in the menu?<br /></div><br /><br /><br />This is the code I placed into joomla.php for function setPageTitle in order not to use "Home" in the front page's title.<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent"><br />function setPageTitle( $title=null ) {<br /><br />  if (@$GLOBALS['mosConfig_pagetitles']) {<br /><br />   $title = trim( htmlspecialchars( $title ) );<br /><br />   if ($title == 'Home')<br />   {<br />      $this->_head['title'] = $GLOBALS['mosConfig_sitename'];<br />   }<br />   else<br />   {<br />      $this->_head['title'] = $title . " - ". $GLOBALS['mosConfig_sitename'];<br /><br />   }           <br />  }<br />}<br /><br /></div> </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>lasor</b> [ Thu Apr 20, 2006 2:40 pm ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" /><div class="quotetitle">panter011 wrote:</div><div class="quotecontent"><br />This hack will help you have your site's title change on every page, displaying the title of the news or any content's title displayed.<br /><br /><a href="http://www.javieryep.com/site1002/content/view/51/29/" class="postlink">http://www.javieryep.com/site1002/content/view/51/29/</a><br /><br />hope it helps<br /></div><br /><br />I tried this and received this error:<br /><br />parse error, unexpected T_CLASS, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in<br /><br />Anybody any ideas? </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>Tim777</b> [ Thu Apr 20, 2006 4:19 pm ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" /><div class="quotetitle">lasor wrote:</div><div class="quotecontent">parse error, unexpected T_CLASS, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in<br /><br />Anybody any ideas?<br /></div><br /><br />In which line is this error? Did you try to change back to the original joomla.php?<br />Have you upgraded to 1.08 version? It works in 1.07 too, but it's better to upgrade first. </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>pli</b> [ Thu Apr 20, 2006 7:27 pm ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" /><div class="quotetitle">Tim777 wrote:</div><div class="quotecontent"><br />In which line is this error? Did you try to change back to the original joomla.php?<br />Have you upgraded to 1.08 version? It works in 1.07 too, but it's better to upgrade first.<br /></div><br /><br />Same results for me - ver 1.08<br /><br />P </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>myuption</b> [ Sat Nov 25, 2006 3:17 am ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" /><div class="quotetitle">Tim777 wrote:</div><div class="quotecontent"><div class="quotetitle"><b>Quote:</b></div><div class="quotecontent">Is there a way of deleting the word "Home" in the landing page title?<br />i.e. Home appears to be the default Component [ FrontPage ] in the menu. Could you remove it from that page title (without turning off Dynamic Page Titles) and still see Home in the menu?<br /></div><br /><br /><br />This is the code I placed into joomla.php for function setPageTitle in order not to use "Home" in the front page's title.<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent"><br />function setPageTitle( $title=null ) {<br /><br />  if (@$GLOBALS['mosConfig_pagetitles']) {<br /><br />   $title = trim( htmlspecialchars( $title ) );<br /><br />   if ($title == 'Home')<br />   {<br />      $this->_head['title'] = $GLOBALS['mosConfig_sitename'];<br />   }<br />   else<br />   {<br />      $this->_head['title'] = $title . " - ". $GLOBALS['mosConfig_sitename'];<br /><br />   }           <br />  }<br />}<br /><br /></div><br /></div>Actually, this one works... but it would be nice if you could set something that states:<br /><br />if ($option != "com_frontpage") instead of if ($title == 'Home')<br /><br />This is the one i used:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">if ($title == 'Home')<br />   {<br />      $this->_head['title'] = $GLOBALS['mosConfig_sitename'];<br />   }<br />   else<br />   {<br />      $this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' - '. $title : $GLOBALS['mosConfig_sitename'];<br /><br />   }</div> </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>oates</b> [ Wed Nov 29, 2006 10:49 pm ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" />Hi, <br /><br />That code worked for me too! <br /><br />BUT, do you know how to 'add a specific title to the home page' it used to have title+home, Now it has the site title only, I would like to add a specific title to homepage alone.<br /><br />Also, how to shift site title to the front of the page title, I noticed with your code, it is pushed to the end, perhaps that is for search indexing purposes? </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>myuption</b> [ Mon Jan 15, 2007 4:52 pm ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" />I know, i'd love to add a little description of my website in Homepage. </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>oshun55</b> [ Wed Feb 14, 2007 5:33 pm ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" />Bumpity bump </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>oates</b> [ Wed Feb 14, 2007 6:34 pm ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" />Aha,<br /><br />the solution is:<br /><br />go to your includes folder and joomla.php and locate the following code and edit accordingly.<br /><br />Replace this:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">   function setPageTitle( $title=null ) {<br />      if (@$GLOBALS['mosConfig_pagetitles']) {<br />         $title = trim( htmlspecialchars( $title ) );<br />         $title = stripslashes($title);<br />         $this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' - '. $title : $GLOBALS['mosConfig_sitename'];<br />      }<br />   }<br />   /**<br />   * @param string The value of the name attibute<br />   * @param string The value of the content attibute<br />   * @param string Text to display before the tag<br />   * @param string Text to display after the tag<br />   */</div><br /><br />with<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">function setPageTitle( $title=null ) {<br />      if (@$GLOBALS['mosConfig_pagetitles']) {<br />         $title = trim( htmlspecialchars( $title ) );<br />         $title = stripslashes($title);<br />        if ($title == 'Home')<br />            {<br />              $title = 'The Religion of all Prophets';<br />            }<br />         $this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' - '. $title : $GLOBALS['mosConfig_sitename'];<br />      }<br />   }<br />   /**<br />   * @param string The value of the name attibute<br />   * @param string The value of the content attibute<br />   * @param string Text to display before the tag<br />   * @param string Text to display after the tag<br />   */</div><br /><br /><br />The main thing to add in is:<br /><br /><strong><span style="color: red">  if ($title == 'Home')<br />            {<br />              $title = 'The Religion of all Prophets';<br />            }</span></strong> </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>oshun55</b> [ Wed Feb 14, 2007 6:39 pm ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" /><div class="quotetitle">oates wrote:</div><div class="quotecontent">Aha,<br /><br />the solution is:<br /><br />go to your includes folder and joomla.php and locate the following code and edit accordingly.<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">function setPageTitle( $title=null ) {<br />      if (@$GLOBALS['mosConfig_pagetitles']) {<br />         $title = trim( htmlspecialchars( $title ) );<br />         $title = stripslashes($title);<br />            if ($title == 'Home')<br />            {<br />              $title = 'The Religion of all Prophets';<br />            }<br />         $this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' - '. $title : $GLOBALS['mosConfig_sitename'];<br />      }<br />   }<br />   /**<br />   * @param string The value of the name attibute<br />   * @param string The value of the content attibute<br />   * @param string Text to display before the tag<br />   * @param string Text to display after the tag<br />   */</div><br /></div><br /><br />I must be dumb, can't locate sode. Please tell me what code to change or line number. </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>draculinos</b> [ Mon Mar 26, 2007 11:21 pm ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" />Can I have for the title : "Product Name - Name of the site "  <br /><br />So I want first to have the name of the product and after that to have the site name.<br /><br />Can this be done?<br /><br />Joomla 1.0.12 Vm 1.0.10<br /><br />Thanks </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>myuption</b> [ Tue Apr 17, 2007 10:06 pm ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" />I changed this a little to show a message on the frontpage.<br /><br />The // part is the original statement in joomla.php<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">//   function setPageTitle( $title=null ) {<br />//      if (@$GLOBALS['mosConfig_pagetitles']) {<br />//         $title = trim( htmlspecialchars( $title ) );<br />//         $title = stripslashes($title);<br />//         $this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' - '. $title : $GLOBALS['mosConfig_sitename'];<br />//      }<br />//   }<br />function setPageTitle( $title=null ) {<br /><br />  if (@$GLOBALS['mosConfig_pagetitles']) {<br /><br />   $title = trim( htmlspecialchars( $title ) );<br /><br />if ($title == 'Home')<br />   {<br />      $this->_head['title'] = $GLOBALS['mosConfig_sitename']. ' - Your Homepage Message';<br />   }<br />   else<br />   {<br />      $this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' - '. $title : $GLOBALS['mosConfig_sitename'];<br /><br />   }          <br />  }</div> </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>seola</b> [ Wed Aug 22, 2007 1:18 am ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" />I would like to remove the site name from every url onthe site<br /><br />now it puts the site name and then page title.<br /><br />Having site name in each url is very bad, why has jooml athat enabled by default? </td> </tr> </table> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">Author: </td> <td><b>cgraham149</b> [ Sat Oct 20, 2007 6:16 am ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">Post subject: </td> <td><b>Re: order of items in generated <title> tag</b></td> </tr> <tr> <td colspan="2"><hr class="sep" />This one thread has been the answer to my prayers...I have been struggling with the way Joomla! deals with the HTML <title> tag for months without having really done anything about it, until now!<br /><br />For those out there who would like to do a whole lot more with their Page Titles here is a Core Hack (mod) that I did on my sites to improve SEO:<br /><br />Around Line #422 you may need to modify like this:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">$this->_head['title']    = $GLOBALS['mosConfig_sitename']." - Promo Text";</div><br /><br />The reason is that when you navigate to another menu item and then back (depending on if you have default Joomla! SEO activated), the page titles won't pick up the "Home" <title swap> when you click on another button and then go back to home by clicking on your site logo rather than the Home button.  Sorry if that sounds confusing...but it works, depending on your site template and how you call the Home URL.<br /><br />But now, here is the real power in changing your site titles.<br /><br />Here is how I expanded on the above code using "elseif":<br /><br />Around Line# 503<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">function setPageTitle( $title=null ) {<br />      if (@$GLOBALS['mosConfig_pagetitles']) {<br />         $title = trim( htmlspecialchars( $title ) );<br />         $title = stripslashes($title);<br />if ($title == 'Home')<br />   {<br />      $title1 = 'City, State';<br />      $title2 = 'Your promo text here - ';<br />      $title3 = ' - Final Catch Phrase Here';<br />      $this->_head['title'] = $title1. " - ".$title2.$GLOBALS['mosConfig_sitename'].$title3;<br />   }<br />elseif ($title == 'News')<br />   {<br />      $title1 = 'News - Your News Caption Here';<br />      $title2 = 'City, State';<br />      $this->_head['title'] = $title1. " - ".$title2. " - ".$GLOBALS['mosConfig_sitename'];<br />   }<br />elseif ($title == 'Whatever_Title_You_want_to_Replace')<br />   {<br />      $title1 = 'Your_New_Title_Here;<br />      $title2 = 'More_Promo_Text_Here';<br />      $this->_head['title'] = $title1. " - ".$title2. " - ".$GLOBALS['mosConfig_sitename'];<br />   }<br />   else<br />   {<br />      $title1 = 'City, State';<br />      $this->_head['title'] = $title1 . " - ".$title. " - ". $GLOBALS['mosConfig_sitename'];<br />   }           <br />  }<br />}<br /></div><br /><br />You can see the live results if you check out my site at <!-- m --><a class="postlink" href="http://www.auburnbuzz.com">http://www.auburnbuzz.com</a><!-- m --><br /><br />Cheers,<br /><br />CG<br /><br />Seola -  If you want to remove the Site Name all together, then remove $GLOBALS['mosConfig_sitename'] wherever it occurs. </td> </tr> </table> <hr width="85%" /> <!-- We request you retain the full copyright notice below including the link to www.phpbb.com. This not only gives respect to the large amount of time given freely by the developers but also helps build interest, traffic and use of phpBB3. If you (honestly) cannot retain the full copyright we ask you at least leave in place the "Powered by phpBB" line. If you refuse to include even this then support on our forums may be affected. The phpBB Group : 2006 // --> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td><span class="gensmall">Page <strong>1</strong> of <strong>1</strong></span></td> <td align="right"><span class="gensmall">All times are UTC </span></td> </tr> <tr> <td colspan="2" align="center"><span class="gensmall">Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group<br />http://www.phpbb.com/</span></td> </tr> </table> </body> </html>