|
Joomla has come really far SEO-wise since the 1.0.x branch, but you can tweak your layouts further using the MVC capabilities of 1.5.
'What is MVC?', you might ask. Well, you can read about it or you can accept my really overly short summary that would probably incite vicious all-caps comments if I put them on the site... Anyway, MVC is a way of building an application that allows for easy edits to the display of your pages. The guts of the application have been made separate so if you want to tweak things without butchering the rest of the program, you can. For 90+% of us tweaking Joomla, this explanation is good enough.
One of the quick issues to fix is the fact that your Joomla article title are not surrounded by H1 tags. Typically you'd want something that summarizes your points, like the headline/title, to have H1 tags. In order to do this without Joomla 1.5's MVC approach, you'd have to hack /components/com_content/views/article/tmpl/default.php. This in turn would mean, that unless you stayed pretty vigilant, any point releases (updates) that came from Joomla might replace your custom code changes. And if you made any more tweaks to other areas of Joomla, you'd have to be that much more on top of what the updates were, well, updating.
Luckily, we don't have to hack the sacred core code.
Copy, through FTP, the command line - whatever, this file /components/com_content/views/article/tmpl/default.php to /templates/<whatever template you're using>/com_content/article/default.php. So /templates/<whatever template you're using> is already going to exist. You'll have to probably create the directories com_content and article within your template directory. I say 'probably' because for whatever reason you might have installed a template which the template designer already understood the MVC concept or someone has already made customizations.
In any case, once you have copied this file to the above desitnation, you're practically done. Now you can hack with (almost) total impunity. If you really screw stuff up, you could just rename your hacked file to default.bak.php and it won't get recognized and Joomla will go back to using the normal default.php for your articles. Or, if you're that frustrated, you can delete your copy and go back to playing WoW.
So, you can do whatever you need to for SEO ort non-SEO purposes. I made the aforementioned H1 edits:
<?php if ($this->params->get('link_titles') && $this->article->readmore_link != '') : ?>
<a href="/<?php echo $this->article->readmore_link; ?>" class="contentpagetitle<?php echo $this->params->get( 'pageclass_sfx' ); ?>">
<?php echo $this->escape($this->article->title); ?></a>
<?php else : ?>
<?php echo $this->escape($this->article->title); ?>
<?php endif; ?>
becomes:
<?php if ($this->params->get('link_titles') && $this->article->readmore_link != '') : ?>
<a href="/<?php echo $this->article->readmore_link; ?>" class="contentpagetitle<?php echo $this->params->get( 'pageclass_sfx' ); ?>">
<h1><?php echo $this->escape($this->article->title); ?></h1></a>
<?php else : ?>
<h1><?php echo $this->escape($this->article->title); ?></h1>
<?php endif; ?>
I also use this to set my meta descriptions:
$document =& JFactory::getDocument();
$description = substr($this->article->text,0,strpos($this->article->text,'</p>'));
$document->setDescription( trim(strip_tags($description)) );
That block is definitely experimental. It basically takes the first paragraph and makes it the meta description for the page. "Now why the hell would you do that?", you might ask. Well, first, because I like to tinker and second because I'm lazy and just like to write my article and not worry about adding in the description in the article page. And third, because from what I know, Google likes there to be some similarity between the description and page content.
Happy Joomla'ing! |