Meta Tags in Sections and Categories

General questions relating to Joomla! There are other boards for more specific help on Joomla! features and extensions.
User avatar
tudorilisoi
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 161
Joined: Sun Nov 27, 2005 9:57 am
Location: Romania
Contact:

Re: Meta Tags in Sections and Categories

Post by tudorilisoi » Tue Jun 20, 2006 9:47 am

I think the title hack is quite important, it gives greater individuality in SE result pages.

If you want "branding", you'd better leave site title first.
A short site title is a good idea, too.
This gives individual item titles more weight and visibility(for SEs).

Anyway, here's the hack for Joomla! 1.0.9:

Replace the whole setPageTitle function (lines 505 trhough 511) with this code:

Code: Select all

function setPageTitle( $title=null ) {
		if (@$GLOBALS['mosConfig_pagetitles']) {
			$title = trim( htmlspecialchars( $title ) );
			$title = stripslashes($title);
			$this->_head['title'] = $title ? $title.' - '.$GLOBALS['mosConfig_sitename']   : $GLOBALS['mosConfig_sitename'];
		}
	}
The same thing, only line number has changed from previous version.
Last edited by tudorilisoi on Tue Jun 20, 2006 9:50 am, edited 1 time in total.
TeachMeJoomla.net - Joomla tutorials, tips, mods, and extensions. Joomla freelance custom programming/development

Jimboot
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Tue Nov 08, 2005 2:00 am
Contact:

Re: Meta Tags in Sections and Categories

Post by Jimboot » Mon Jul 03, 2006 11:31 am

Ok title site swap works in 1.10 now to try the metatag hack.
I always forget to change this and wonder why my rankings go haywire after an upgrade.... why hasn't this been changed 5 versions ago? Just curious.
Thanks guys

jayw
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Wed Oct 19, 2005 9:22 pm

Re: Meta Tags in Sections and Categories

Post by jayw » Tue Aug 29, 2006 9:39 am

If anyone integrates these into 1.0.11 could you post your results?

Thanks,

-jay

caleb2001r
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 114
Joined: Mon Sep 05, 2005 6:07 am

Re: Meta Tags in Sections and Categories

Post by caleb2001r » Fri Sep 08, 2006 2:46 am

Anyone implement this yet?  Interested to see the code to do so.

caleb2001r
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 114
Joined: Mon Sep 05, 2005 6:07 am

Re: Meta Tags in Sections and Categories

Post by caleb2001r » Fri Sep 08, 2006 2:37 pm

Bump.  This is a really important part of SEO no?

caleb2001r
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 114
Joined: Mon Sep 05, 2005 6:07 am

Re: Meta Tags in Sections and Categories

Post by caleb2001r » Mon Sep 11, 2006 2:48 am

I've discovered that you can accomplish the title modifications using this following core hack.  [LINK]

User avatar
Kampp
Joomla! Guru
Joomla! Guru
Posts: 563
Joined: Tue Aug 30, 2005 9:18 am
Location: Denmark
Contact:

Re: Meta Tags in Sections and Categories

Post by Kampp » Mon Sep 11, 2006 4:46 pm

Good job - great link.

I sure hope that this will be on the Joomla agenda very soon so we don't need to hack the core!
http://www.toolmaster.dk - Danish Joomla Services!

caleb2001r
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 114
Joined: Mon Sep 05, 2005 6:07 am

Re: Meta Tags in Sections and Categories

Post by caleb2001r » Mon Sep 11, 2006 5:34 pm

Agreed.  The hard part is remember to reapply the hacks after updates.  The updates lately have been critical so it's pretty much a necessity to update.

User avatar
damo
Joomla! Explorer
Joomla! Explorer
Posts: 481
Joined: Tue Aug 23, 2005 12:49 pm
Location: Sweden
Contact:

Re: Meta Tags in Sections and Categories

Post by damo » Thu Nov 30, 2006 9:52 pm

does this work in 1.0.11?

am i basically right in thinking this:

1. on the homepage it shows just the gloabl meta keywords/descriptions
2. then on individual content pages it puts the description and keywords of the individual content item before the global?

it would be really nice if this worked in 1.0.11??

jayw
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Wed Oct 19, 2005 9:22 pm

Re: Meta Tags in Sections and Categories

Post by jayw » Mon Feb 12, 2007 11:07 am

I've got "Home -" at the beginning of the on the home page.

I've implemented the other hacks in this this thread and its still there.

How would you check the string for "Home - " and redact it if it exists?

-jay



vavroom wrote: Switching title/sitename:

In your files, open /includes/joomla.php

Around line 475 (may vary from version to version), find:

Code: Select all

$this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' - '. $title : $GLOBALS['mosConfig_sitename'];
Replace with:

Code: Select all

$this->_head['title'] = $title ? $title .' - '. $GLOBALS['mosConfig_sitename'] : $GLOBALS['mosConfig_sitename'];
Make sure you back up your file first, in case it causes you problems, but it shouldn't.

Thanks to Jinx who pointed out the obvious to me, which I had been looking at and not seeing... :)


Locked

Return to “General Questions - 1.0.x”