Page 3 of 4

Re: Custom Title Tag Hack for every page

Posted: Wed Nov 15, 2006 5:44 pm
by eyezberg
thanks slim' ;)
(OT: are you using the extended commercial SEF patch? is it really better than the free one?)

Re: Custom Title Tag Hack for every page

Posted: Wed Nov 15, 2006 6:32 pm
by slimtreeshadow
I'm not sure how much better it is - but it was cheap and does a few cool things. Custom meta tags for one - so I could add a verify-1 tag for Google Sitemaps. There are a few other little things too - nothing a good coder can't do but I'm not coder.

I will say that if they add customizable title tags for menu items, categories, etc that it would be a great patch.

I'm still uneasy about using the title hack here w/ 1.011 since SEF is running too. They don't play nice together. So it's pluses and minuses of both I guess

JPromoter - Joomla SEO Great Tool

Posted: Thu Nov 16, 2006 6:41 pm
by arikzara
I passed through this post on my research for a way to find a way to find a way to optimize my website. The hack here was much too complicated for me to implement. Too many files to changes etc, got me freaked! I am not a computer technical person, so it was above my abilites. I found another way to fix it, I though it would be good to post it here for people to know. Let me tell you the story.

I am a search engine optimizer. I recently built my first joomla website and was heading to perform some optimization work. Being so amazed how cool and advanced joomla is, I was pretty convinced all through that joomla is SEO friendly. However, when I noticed that I cannot control and modify my pages'   field, on every page separately, I got so freaked! I just couldn't believe how this is possible. I mean, is there something more important than controlling your meta and title fields for efficient SEO? How do all these joomla websites do their marketing?

I checked on Joomla's extension directory and found almost nothing there. I then bought one of the components listed there, which was no good at all. I went deepr in the list, to those non-reviewed components that no one gets to. To make the story short, at the end of the list I found a component, with no stars, 65$, from a guy working in Kyrgyzstan! I checked a little on the map, to see where it is. Seems to me be a beautiful place! Anyway, I didn't have much choices and his site looked pretty good. From the website description the component seemed excellent. The guy (Sergey) has there his MSN and Skype account details. I contacted him and he promised to help me if I have any problem with the installation / component.

So, I bought it! I am so so so so so relieved and happy. My god, it is EXCELLENT. Dollars put exactly in the right place. It's been a few days that I am doing my optimization, being able to modify the meta fields and title field of every page on my website (separately)!

And even more important - the developer of this component, Sergey, is a wonderful guy. I have never seen such level of support, anywhere. He is there for me on the Skype with every issue. He helped me out a lot, and even added some features to the component to my request.

To sum up. Thank you Sergey. This is indeed a great tool! 

PS - almost forgot to let you know of the name of the component... JPromoter - Joomla SEO Great Tool http://joomlaequipment.com/  ;)

Re: Custom Title Tag Hack for every page

Posted: Wed Nov 22, 2006 9:09 pm
by eyezberg
Too bad there's no solution for this hack to work with the free sef patch & sef.

JPromoter does look good, you can even test the backend on the demo site,
but the price is more than I'm willing to invest to test this on J! 1.0.x ..

Re: Custom Title Tag Hack for every page

Posted: Mon Nov 27, 2006 7:37 pm
by slimtreeshadow
To update this thread - Joomlatwork have released an upgrade for the SEF paid version. It allows title tags to be set in meta data completely separately from the content titles. Nice addition and it's still under 10 bucks for the component.

We still don't have control over the meta data for categories or sections, but that's hopefully coming in 1.5

Re: Custom Title Tag Hack for every page

Posted: Tue Dec 12, 2006 2:23 am
by cgourlay
I just took this a step further and modified it so I could assign the page title from a non-Joomla database table. I'm using mosmodule to help move my old site to Joomla! It's a travel site with a bunch of hotels kept in a database. When I show the hotel details, I want the page title to be the name of the hotel, which can't be done using the parameters of this hack. Maybe somebody can improve this and bring it up to Joomla standards, but here it is:

In Joomla.php

function setPageTitle( $title=null, $params=null ) {
$hotel = mosGetParam( $_REQUEST, 'hotel', "" );
if ( $hotel ) {
//echo "hotel";
$sq="select * from hotels where hotel_id='$hotel'";
          $rs=mysql_query($sq);
          $hoteldata = mysql_fetch_array($rs);
          echo "$hoteldata[name]";
$params = new mosParameters(stripslashes($hoteldata[name]));
$this->_head['title'] = $hoteldata[name];
}
elseif
(@$GLOBALS['mosConfig_pagetitles']) {
if ($params) {
$custom_title = $params->def( 'title_cust', '' );
} else {
global $database, $mainframe, $Itemid, $hotel;
$params = new stdClass();


if ( $Itemid ) {
$menu = new mosMenu( $database );
$menu->load( $Itemid );
$params = new mosParameters( $menu->params );
} else {
$menu = "";
$params = new mosParameters( '' );
}
$custom_title = $params->def( 'title_cust', '' );
}
$title = $custom_title ? $custom_title : $GLOBALS['mosConfig_sitename'] . ' - '. $title;
$title = trim( htmlspecialchars( $title ) );
$this->_head['title'] = $title ? $title : $GLOBALS['mosConfig_sitename'];
}
}

Re: Custom Title Tag Hack for every page

Posted: Tue Dec 26, 2006 9:54 pm
by php4ever
testing for 1.0.12 today

Jared

Re: Custom Title Tag Hack for every page

Posted: Tue Jan 16, 2007 10:47 pm
by dvdbdgr
This is a great hack - works like a charm.  Thanks!

Re: Custom Title Tag Hack for every page

Posted: Sun Feb 18, 2007 8:15 pm
by dalmatino
Thanx for this magnificent hack!!! Is there a way to do dhis for sections/categories?

Re: Custom Title Tag Hack for every page

Posted: Sun Feb 25, 2007 9:44 pm
by apc
Excellent hack, but is there such an issue having the page title and header Title tag the same as Joomla with dynamic titles switched on does now? Matching page and header title is good SEO surely?

Re: Custom Title Tag Hack for every page

Posted: Tue Mar 13, 2007 10:59 pm
by moontear
I'm having problems... Currently I am using this code:

Code: Select all

$title = $custom_title ? $custom_title  . ' - ' . $GLOBALS['mosConfig_sitename'] : $GLOBALS['mosConfig_sitename'] . ' - '. $title;
Wrong behavior:
On a component menu item with a custom title set, I only get "$customtitle" as titlebar.
At a normal site (Home in particular) with normal "Page title" set to home, I only get "$sitename - "

The behaviour I want to achieve is the following for ALL sites (with or without customtitle):
"$sitename - $pagetitle" (pagetitle refers to either normal page title or custom title, whichever is there)

Hope somebody can help, thanks
moon

Re: Custom Title Tag Hack for every page

Posted: Tue May 29, 2007 11:42 am
by no_name23
hi,
i have followed all steps and didnt work for me, i have joomla 1.0.12 and i have install this components opensef, joomseo, jreview, imbed php. anyone has any idea?

Re: Custom Title Tag Hack for every page

Posted: Thu May 31, 2007 10:00 pm
by Wounded Knee
For main page (frontpage) and sections/categories:

In "administrator/components/com_frontpage/frontpage.xml"
Add:

Code: Select all

<param name="title_cust" type="text" size="20" default="" label="Custom Title Tag" description="A custom Title tag to be applied to the page, this allows individual page titling" />
In:
"administrator/components/com_menus/content_blog_category"
"administrator/components/com_menus/content_blog_section"
"administrator/components/com_menus/content_category"
"administrator/components/com_menus/content_section"
edit their *..xml files too.
Add:

Code: Select all

<param name="title_cust" type="text" size="20" default="" label="Custom Title Tag" description="A custom Title tag to be applied to the page, this allows individual page titling" />
In: "components/com_content/content.php"
find and replace all:

Code: Select all

$mainframe->SetPageTitle( $menu->name );
by

Code: Select all

$mypagetitle = $params->get ('title_cust');
$mainframe->SetPageTitle( $mypagetitle );
It works for me.

cheers

Re: Custom Title Tag Hack for every page

Posted: Fri Jun 01, 2007 8:09 am
by no_name23
it works now thanks

Re: Custom Title Tag Hack for every page

Posted: Thu Jun 07, 2007 11:16 am
by Rinnert
php4ever wrote: testing for 1.0.12 today

Jared
does this work for joomla 1.0.12 ?? I really would like to use this hack or is there an other way to edit the pagetitle ?

Re: Custom Title Tag Hack for every page

Posted: Wed Jul 11, 2007 7:28 pm
by jameswatt82
I have followed the Same steps but it did not work for me

i have Joomla 1.0.12 version , even i am not able to see my home page

if i am typing my domain name in browser it shows me blank page but i can view other component pages,

i am not able to see the content pages of my site after following the above steps

Can any one have any ides.. before implementing Joomla Customize Title hack i took Backup

urgent help is required

Re: JOOMLA 1.0.11 Custom Title Tags

Posted: Wed Aug 08, 2007 6:40 pm
by josey
php4ever wrote: Here is a zip file I created with all the changes and backups in place. 

Its intended for use by new installs of Joomla 1.0.11, however if you have third party components you will just need to go to those components and add the following line as originally instructed.



I will maintain successive packages to help out with barnett if thats ok, as each release of Joomla becomes available so in the event that Joomla releases 1.0.12 and so on I'll make it as an easy drop in.

Just follow the instructions in the README.TXT file included with the zip. http://www.jaredsdesigns.com/downloads/ ... 1.0.11.zip

~ Jared
POST KEYWORDS: "Joomla 1.0.11 Custom Title, Titles Tags, Dynamic Titles"
PS Good Job "barnett"

php4ever mentioned this above.
Anybody confirm this with J 1.0.13 ?
The files are not posted as said above? Maybe they will be soon?

I pulled down a J1.0.9 site that the hack is working fine with on a live site , Locally I'm have trouble getting it going with J1.0.13 with the same site.

I also tried the 'find and replace' mentioned above in the content.php and nothing? XML files edited, (can see the parameter in the content page)

Cheers

Re: Custom Title Tag Hack for every page

Posted: Thu Aug 09, 2007 12:13 pm
by Fletch
Me too... has this been fixed yet?
moontear wrote: I'm having problems... Currently I am using this code:

Wrong behavior:
On a component menu item with a custom title set, I only get "$customtitle" as titlebar.
At a normal site (Home in particular) with normal "Page title" set to home, I only get "$sitename - "

The behaviour I want to achieve is the following for ALL sites (with or without customtitle):
"$sitename - $pagetitle" (pagetitle refers to either normal page title or custom title, whichever is there)

Hope somebody can help, thanks
moon
This is the code I am using

Code: Select all

$title = $custom_title ? $custom_title  . ' - ' . $GLOBALS['mosConfig_sitename'] : $GLOBALS['mosConfig_sitename'] . ' - '. $title;
$title = trim( htmlspecialchars( $title ) );
$this->_head['title'] = $title ? $title : $GLOBALS['mosConfig_sitename'];
Any help appreciated  :)

SORTED...
This is the code I've used

Code: Select all

$title = $custom_title ? $GLOBALS['mosConfig_sitename']  . ' : ' . $custom_title : $GLOBALS['mosConfig_sitename'] .' : '. $title;

Re: Custom Title Tag Hack for every page

Posted: Thu Aug 09, 2007 1:44 pm
by Fletch
OH NO  :o

I cannot login at the front end after making these changes. I've double checked all the changes and they all seem to be OK.
Anyone have any ideas  ???

SORTED...

I re-installed all the changed core Joomla files and the frontend login started working again. Never one to be beaten I re-checked all the hacked modified files and uploaded them again and this time everything worked fine... must have been finger trouble  :-[

Great job  :)

Re: Custom Title Tag Hack for every page

Posted: Tue Aug 28, 2007 10:20 pm
by drvanitus
I just wanted to point out that THIS STILL WORKS and I'm a little stunned why something so simple as this would not be included in Joomla! core.  Many thanks to the author of this hack.

I just installed this on Joomla! 1.0.12 and it works like a charm.  I followed exact instructions from the original post, it works, it works too well!! :)
You can see working example at http://balkanmultimedia.com/ - there is no more generic titles, restricted to menu item name. Thanks again!

Note:  If you have SEF PATCH installed, it might not work, so you will have to uninstall that.  The first time I did this hack, I had SEF Patch installed and it did not work.  I did rush through the hacking process, so I might have messed up something.  However, I decided to uninstall SEF Patch and re-do the hack, it works like a charm.  I can't tell you how happy I am with this.  This probably needs to be stickied.

Re: Custom Title Tag Hack for every page

Posted: Mon Sep 03, 2007 6:43 am
by doorcounty
I went through the whole process and everything seemed fine through step 2.  When I finished steps 3 and 4 tonight and attempted to use the new system, I got these messages:


Warning: main(file:///C|/Documents and Settings/Judy Moller/.unlimitedftp/temp/globals.php) [function.main]: failed to open stream: No such file or directory in /home/doorcoun/public_html/index.php on line 24

Warning: main() [function.include]: Failed opening 'file:///C|/Documents and Settings/Judy Moller/.unlimitedftp/temp/globals.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/doorcoun/public_html/index.php on line 24

Warning: main(file:///C|/Documents and Settings/Judy Moller/.unlimitedftp/temp/configuration.php) [function.main]: failed to open stream: No such file or directory in /home/doorcoun/public_html/index.php on line 25

Fatal error: main() [function.require]: Failed opening required 'file:///C|/Documents and Settings/Judy Moller/.unlimitedftp/temp/configuration.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/doorcoun/public_html/index.php on line 25

I went back and un-did steps 3 and 4 but and now still getting this response.  Where did I screw up?

Thanks for the help - this is all pretty new to me.

Re: Custom Title Tag Hack for every page

Posted: Mon Sep 03, 2007 7:06 pm
by doorcounty
Made some changes and get this response on my site when  i try to access it:


Fatal error: Call to a member function on a non-object in /home/doorcoun/public_html/index.php on line 37

Re: Custom Title Tag Hack for every page

Posted: Mon Nov 26, 2007 3:37 am
by GiselaGiardino
GREAT JOB DONE!!! Thank you so very much for sharing this. It works perfectly here, and it was right exactly what I needed. Gracias!!!

Now trying to make joomfish translate this field too... that would make this hack utter awesome. Any ideas? I´m searching... THX

Custom Title Tag Hack - FOR JOOMFISH

Posted: Mon Nov 26, 2007 6:53 pm
by GiselaGiardino
OK, I´m back. I will share the solution I found for making Joomfish translate this Custom Titles, too. I am no database guru :-[ , so apologises for the poor explanation.  ;)

I found via MySQL admin, that in the joomla database, this parameter "title_cust" is saved in the field "Attribs" at the _content table and in the rest of tables where it has been added via de XML, the parameter is saved in the "params" field.

With this information I was able to modify the XML files of the Joofish component: to tell the component which field should be added to the transalation panel.

So as done for the custom title hack, I looked for the xml to modify. They are here:

administrator/components/com_joomfish/contentelements/

Then I made the following addition to content.xml :

Code: Select all

<field type="textarea" name="attribs" translate="1">Attributes (inc. title_cust)</field>
Where "Attributes (inc. title_cust)" is the label visible in the translation page. You can customize it to your preference.

And the in the rest of the xml files ( categories.xml, neewsfeed.xml, sections.xml, contact.xml, weblinks.xml, ETCETERAS) I added the line:

Code: Select all

<field type="textarea" name="params" translate="1">Attributes (inc. title_cust)</field>
If everything worked fine (otherwise Joomfish won´t load properly and sends an error message), when you choose a file to translate, it should now appear a textarea, where to translate this "params" or "attribs" field. I recommend to copy the original contents to the translation text field and make the only changes necessary to it (in the "title_cust=" value alone).

Hope it helps... It works here. Thanks again. 

Re: Custom Title Tag Hack for every page

Posted: Sun Dec 02, 2007 6:00 pm
by moontear
Using Joomla 1.0.13.

I just tried the steps explained, but just can't seem to get the Sitename shop up in front of the content items.

Basically I want the format [SITENAME] - [SECTION] - [CATEGORY] - [ITEM].

Nothing special, but the Sitename will just not show up. This also happened when NOT having installed the custom title hack. In the global configuration the appropriate site name is set. Do I have to set it somewhere that it preprends the sitename to all title fields?

Re: Custom Title Tag Hack for every page

Posted: Fri Jan 04, 2008 3:41 pm
by cgourlay
moontear wrote: Using Joomla 1.0.13.

I just tried the steps explained, but just can't seem to get the Sitename shop up in front of the content items.

Basically I want the format [SITENAME] - [SECTION] - [CATEGORY] - [ITEM].

Nothing special, but the Sitename will just not show up. This also happened when NOT having installed the custom title hack. In the global configuration the appropriate site name is set. Do I have to set it somewhere that it preprends the sitename to all title fields?
You actually don't want this, for SEO purposes. Your titles should be short, and unique on each page.

Re: Custom Title Tag Hack for every page

Posted: Sun Jan 06, 2008 8:56 pm
by bzeke
I just implemented this and so far everything is working great, except I found one minor problem. When a user tries to change their details, the parameters for users.xml (in administrator/components/com_users) are displayed instead of the typical "Update" button. Any help would is appreciated!

http://www.wholesale-organic.com/store/ ... tails.html

Re: Custom Title Tag Hack for every page

Posted: Fri Mar 21, 2008 9:18 am
by ct81flo
This hack, work with alberghi component and sh404sef? thanks

Re: Custom Title Tag Hack for every page

Posted: Wed Oct 15, 2008 4:14 am
by jmarvin
Hello, thanks for a cool hack! It almost works great, but I'm having a problem.

1. In joomla.php, this line:
$this->_head['title'] = $title .' - '. $GLOBALS['mosConfig_sitename'];
...does not generate the site name.

2. If I use the site name in my custom title tag, it doesn't display it. However, if I change the site name or use something else in my custom title, then it works fine.

I've tried several things like changing the case, or adding then stripping underscores, but when I make it match the site name, it won't display.

Does that make any sense?

Something happens after "function setPageTitle" that removes an exact match for the site name.

What I CAN do is manually add the site name to the custom title tag, but make it all lower-case or all upper-case instead.

Does anyone know what can be causing this problem? Thanks for any help.

Re: Custom Title Tag Hack for every page

Posted: Thu Mar 12, 2009 7:28 am
by guruananthe
yes its working on my joomla site.nice crack.thanks again