| Joomla! http://forum.joomla.org/ |
|
| order of items in generated http://forum.joomla.org/viewtopic.php?f=32&t=3849 |
Page 1 of 1 |
| Author: | freeman [ Mon Sep 05, 2005 4:02 pm ] |
| Post subject: | order of items in generated |
hi there. the standard generation of the title-tag is as follows: i want it: 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 |
/includes/mambo.php Line 245 Code: function setPageTitle( $title=null ) { if (@$GLOBALS['mosConfig_pagetitles']) { $title = trim( htmlspecialchars( $title ) ); $this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' - '. $title : $GLOBALS['mosConfig_sitename']; } } This is for Mambo 4.5.2.3 |
|
| Author: | freeman [ Mon Sep 05, 2005 4:53 pm ] |
| Post subject: | Re: order of items in generated |
thanks stingrey, i found exactly the same lines, but: what and how to change? thanks for your patience. Norman |
|
| Author: | stingrey [ Mon Sep 05, 2005 5:30 pm ] |
| Post subject: | Re: order of items in generated |
Replace with Code: function setPageTitle( $title=null ) { if (@$GLOBALS['mosConfig_pagetitles']) { $title = trim( htmlspecialchars( $title ) ); $this->_head['title'] = $title ? $title . ' - ' . $GLOBALS['mosConfig_sitename'] : $GLOBALS['mosConfig_sitename']; } } Please backup this file before modifying! |
|
| Author: | freeman [ Mon Sep 05, 2005 5:33 pm ] |
| Post subject: | following error... |
Thanks a lot, but I still get an error: DELETED***** SORRY! I was wrong. IT WORKS! Thanks! Norman |
|
| Author: | diilbert [ Thu Sep 15, 2005 2:47 pm ] |
| Post subject: | Re: order of items in generated |
Thanks. Was exactly what I was looking for
|
|
| Author: | pli [ Thu Nov 10, 2005 10:05 am ] |
| Post subject: | Re: order of items in generated |
stingrey wrote: Replace with Code: function setPageTitle( $title=null ) { if (@$GLOBALS['mosConfig_pagetitles']) { $title = trim( htmlspecialchars( $title ) ); $this->_head['title'] = $title ? $title . ' - ' . $GLOBALS['mosConfig_sitename'] : $GLOBALS['mosConfig_sitename']; } } Please backup this file before modifying! This is excellent stingrey - thank you. Is there a way of deleting the word "Home" in the landing page title? 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? cheers Peter |
|
| Author: | ¥ [ Sat Nov 12, 2005 2:21 am ] |
| Post subject: | Re: order of items in generated |
Hi, for those wishing to remove the Site Name from the title altogether: Code: function setPageTitle( $title=null ) { if (@$GLOBALS['mosConfig_pagetitles']) { $title = trim( htmlspecialchars( $title ) ); $this->_head['title'] = $title; } } It seems logical and has worked so far on my site - but please let me know if it might cause an error. |
|
| Author: | ¥ [ Thu Nov 17, 2005 5:09 am ] |
| Post subject: | Re: order of items in generated |
Hi - this method seems to work extremely well, except in cases of menu items pointing to Section and Category blogs. In those cases, Joomla ignores the page title prescribed in parameters and uses the name given to the menu item. For SEO purposes, this isn't very helpful - as navigation menu titles are extremely short, while SEO'd Thanks very much for any help/advice. |
|
| Author: | brad [ Mon Nov 21, 2005 12:35 am ] |
| Post subject: | Re: order of items in generated |
Have you tried a 3rd party sef component? opensef, 404sef ?? It might give you more control. |
|
| Author: | ¥ [ Mon Nov 21, 2005 1:13 am ] |
| Post subject: | Re: order of items in generated |
Using OpenSEF - also, the system works perfectly for normal pages - pulling the 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: Code: function setPageTitle( $title=null ) { if (@$GLOBALS['mosConfig_pagetitles']) { $title = trim( htmlspecialchars( $title ) ); $this->_head['title'] = $title; } } 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? 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? |
|
| Author: | ¥ [ Mon Nov 21, 2005 1:29 am ] |
| Post subject: | Re: order of items in generated |
I also tried implementing a different menu system - the extended menu module - and had the same results. |
|
| Author: | compass [ Mon Nov 21, 2005 1:58 am ] |
| Post subject: | Re: order of items in generated |
Have you tried openSEF, it allows fine control of titles/URL's etc. I think I have mine set up as: URL: comes from title alias Page Title: comes from article title 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... |
|
| Author: | ¥ [ Mon Nov 21, 2005 2:21 am ] |
| Post subject: | Re: order of items in generated |
Let me know if I'm wrong here - But Joomla now uses mosShowHeader to generate all header information - The page title tags (not SEF URLs) are then generated by includes/joomla.php, as specified in this thread. 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. 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. |
|
| Author: | lexi [ Mon Dec 12, 2005 4:09 pm ] |
| Post subject: | Re: order of items in generated |
I have many different Link Categories. No matter where I go, the title says: "web links" I have 404 sef installed. If I add a new Weblink Category I DO NOT have the following options: 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. Meta Keyword: Enter here the Meta keywords to be used for the page. Meta Description: Enter here the Meta Description to be used for the page. http://forum.joomla.org/index.php/topic,24178.0.html So does anyone know what's wrong here? |
|
| Author: | panter011 [ Sat Feb 04, 2006 10:02 am ] |
| Post subject: | Re: order of items in generated |
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. http://www.javieryep.com/site1002/content/view/51/29/ hope it helps |
|
| Author: | Tim777 [ Sat Mar 25, 2006 3:54 pm ] |
| Post subject: | Re: order of items in generated |
Quote: Is there a way of deleting the word "Home" in the landing page title? 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? This is the code I placed into joomla.php for function setPageTitle in order not to use "Home" in the front page's title. Code: function setPageTitle( $title=null ) { if (@$GLOBALS['mosConfig_pagetitles']) { $title = trim( htmlspecialchars( $title ) ); if ($title == 'Home') { $this->_head['title'] = $GLOBALS['mosConfig_sitename']; } else { $this->_head['title'] = $title . " - ". $GLOBALS['mosConfig_sitename']; } } } |
|
| Author: | lasor [ Thu Apr 20, 2006 2:40 pm ] |
| Post subject: | Re: order of items in generated |
panter011 wrote: 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. http://www.javieryep.com/site1002/content/view/51/29/ hope it helps I tried this and received this error: parse error, unexpected T_CLASS, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in Anybody any ideas? |
|
| Author: | Tim777 [ Thu Apr 20, 2006 4:19 pm ] |
| Post subject: | Re: order of items in generated |
lasor wrote: parse error, unexpected T_CLASS, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in Anybody any ideas? In which line is this error? Did you try to change back to the original joomla.php? Have you upgraded to 1.08 version? It works in 1.07 too, but it's better to upgrade first. |
|
| Author: | pli [ Thu Apr 20, 2006 7:27 pm ] |
| Post subject: | Re: order of items in generated |
Tim777 wrote: In which line is this error? Did you try to change back to the original joomla.php? Have you upgraded to 1.08 version? It works in 1.07 too, but it's better to upgrade first. Same results for me - ver 1.08 P |
|
| Author: | myuption [ Sat Nov 25, 2006 3:17 am ] |
| Post subject: | Re: order of items in generated |
Tim777 wrote: Quote: Is there a way of deleting the word "Home" in the landing page title? 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? This is the code I placed into joomla.php for function setPageTitle in order not to use "Home" in the front page's title. Code: function setPageTitle( $title=null ) { if (@$GLOBALS['mosConfig_pagetitles']) { $title = trim( htmlspecialchars( $title ) ); if ($title == 'Home') { $this->_head['title'] = $GLOBALS['mosConfig_sitename']; } else { $this->_head['title'] = $title . " - ". $GLOBALS['mosConfig_sitename']; } } } if ($option != "com_frontpage") instead of if ($title == 'Home') This is the one i used: Code: if ($title == 'Home')
{ $this->_head['title'] = $GLOBALS['mosConfig_sitename']; } else { $this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' - '. $title : $GLOBALS['mosConfig_sitename']; } |
|
| Author: | oates [ Wed Nov 29, 2006 10:49 pm ] |
| Post subject: | Re: order of items in generated |
Hi, That code worked for me too! 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. 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? |
|
| Author: | myuption [ Mon Jan 15, 2007 4:52 pm ] |
| Post subject: | Re: order of items in generated |
I know, i'd love to add a little description of my website in Homepage. |
|
| Author: | oshun55 [ Wed Feb 14, 2007 5:33 pm ] |
| Post subject: | Re: order of items in generated |
Bumpity bump |
|
| Author: | oates [ Wed Feb 14, 2007 6:34 pm ] |
| Post subject: | Re: order of items in generated |
Aha, the solution is: go to your includes folder and joomla.php and locate the following code and edit accordingly. Replace this: Code: function setPageTitle( $title=null ) { if (@$GLOBALS['mosConfig_pagetitles']) { $title = trim( htmlspecialchars( $title ) ); $title = stripslashes($title); $this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' - '. $title : $GLOBALS['mosConfig_sitename']; } } /** * @param string The value of the name attibute * @param string The value of the content attibute * @param string Text to display before the tag * @param string Text to display after the tag */ with Code: function setPageTitle( $title=null ) { if (@$GLOBALS['mosConfig_pagetitles']) { $title = trim( htmlspecialchars( $title ) ); $title = stripslashes($title); if ($title == 'Home') { $title = 'The Religion of all Prophets'; } $this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' - '. $title : $GLOBALS['mosConfig_sitename']; } } /** * @param string The value of the name attibute * @param string The value of the content attibute * @param string Text to display before the tag * @param string Text to display after the tag */ The main thing to add in is: if ($title == 'Home') { $title = 'The Religion of all Prophets'; } |
|
| Author: | oshun55 [ Wed Feb 14, 2007 6:39 pm ] |
| Post subject: | Re: order of items in generated |
oates wrote: Aha, the solution is: go to your includes folder and joomla.php and locate the following code and edit accordingly. Code: function setPageTitle( $title=null ) { if (@$GLOBALS['mosConfig_pagetitles']) { $title = trim( htmlspecialchars( $title ) ); $title = stripslashes($title); if ($title == 'Home') { $title = 'The Religion of all Prophets'; } $this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' - '. $title : $GLOBALS['mosConfig_sitename']; } } /** * @param string The value of the name attibute * @param string The value of the content attibute * @param string Text to display before the tag * @param string Text to display after the tag */ I must be dumb, can't locate sode. Please tell me what code to change or line number. |
|
| Author: | draculinos [ Mon Mar 26, 2007 11:21 pm ] |
| Post subject: | Re: order of items in generated |
Can I have for the title : "Product Name - Name of the site " So I want first to have the name of the product and after that to have the site name. Can this be done? Joomla 1.0.12 Vm 1.0.10 Thanks |
|
| Author: | myuption [ Tue Apr 17, 2007 10:06 pm ] |
| Post subject: | Re: order of items in generated |
I changed this a little to show a message on the frontpage. The // part is the original statement in joomla.php Code: // function setPageTitle( $title=null ) {
// if (@$GLOBALS['mosConfig_pagetitles']) { // $title = trim( htmlspecialchars( $title ) ); // $title = stripslashes($title); // $this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' - '. $title : $GLOBALS['mosConfig_sitename']; // } // } function setPageTitle( $title=null ) { if (@$GLOBALS['mosConfig_pagetitles']) { $title = trim( htmlspecialchars( $title ) ); if ($title == 'Home') { $this->_head['title'] = $GLOBALS['mosConfig_sitename']. ' - Your Homepage Message'; } else { $this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' - '. $title : $GLOBALS['mosConfig_sitename']; } } |
|
| Author: | seola [ Wed Aug 22, 2007 1:18 am ] |
| Post subject: | Re: order of items in generated |
I would like to remove the site name from every url onthe site now it puts the site name and then page title. Having site name in each url is very bad, why has jooml athat enabled by default? |
|
| Author: | cgraham149 [ Sat Oct 20, 2007 6:16 am ] |
| Post subject: | Re: order of items in generated |
This one thread has been the answer to my prayers...I have been struggling with the way Joomla! deals with the HTML 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: Around Line #422 you may need to modify like this: Code: $this->_head['title'] = $GLOBALS['mosConfig_sitename']." - Promo Text"; 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" But now, here is the real power in changing your site titles. Here is how I expanded on the above code using "elseif": Around Line# 503 Code: function setPageTitle( $title=null ) { if (@$GLOBALS['mosConfig_pagetitles']) { $title = trim( htmlspecialchars( $title ) ); $title = stripslashes($title); if ($title == 'Home') { $title1 = 'City, State'; $title2 = 'Your promo text here - '; $title3 = ' - Final Catch Phrase Here'; $this->_head['title'] = $title1. " - ".$title2.$GLOBALS['mosConfig_sitename'].$title3; } elseif ($title == 'News') { $title1 = 'News - Your News Caption Here'; $title2 = 'City, State'; $this->_head['title'] = $title1. " - ".$title2. " - ".$GLOBALS['mosConfig_sitename']; } elseif ($title == 'Whatever_Title_You_want_to_Replace') { $title1 = 'Your_New_Title_Here; $title2 = 'More_Promo_Text_Here'; $this->_head['title'] = $title1. " - ".$title2. " - ".$GLOBALS['mosConfig_sitename']; } else { $title1 = 'City, State'; $this->_head['title'] = $title1 . " - ".$title. " - ". $GLOBALS['mosConfig_sitename']; } } } You can see the live results if you check out my site at http://www.auburnbuzz.com Cheers, CG Seola - If you want to remove the Site Name all together, then remove $GLOBALS['mosConfig_sitename'] wherever it occurs. |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|