July 11, 2006 - kenshinjeff

Joomla quick SEO coding tips

$GLOBALS[‘mosConfig_sitename’] = “kenshinjeff joomla tips website”;

global $mainframe;
$mainframe->setPageTitle( “This is the sub title!” );

$mainframe->addMetaTag( “keywords-new”, “new, keywords-new, metatag” );
$mainframe->appendMetaTag( “keywords”, “tutorial, component, module, tips” );
$mainframe->prependMetaTag( “keywords”, “kenshinjeff, joomla, SEO, ” );

$mainframe->addCustomHeadTag( “” );

It’s a pretty simple chunk of code that’s self explanatory. If this is to be used in a component, you have to write this in the logic section, not the presentation section. ie ( component.php and not component.html.php )

addCustomHeadTag(“whatever tag you want”) adds a custom chunk of code between the usual HEAD of the html page. I wanted to put a one liner js that pops up the word “HI!” but the default wordpress editor doesn’t like it for some reason.

This probably would save you 30 mins of searching.

Normally I wouldn’t even be borthered with SEO and stuff like that. But once again, I am required to write a custom component to make it “more SEO compliant”.

It’s not like I didn’t learn anything, but the fact that I personally have to scour through code that makes it irritating. In my personal opinion, SEO gives starter sites a fighting chance against the already established sites, but of course, if your site is static and doesn’t update frequently, what’s the point, really?

The reasons why I’m writing sooo many Joomla tips are very simple:

  • The documentation is horrible
  • All I get from Google searchs are Mambo results and answers that go nowhere.
  • My solutions are TRIED and TESTED on a default installation of Joomla, WITHOUT touching core Joomla code.
  • It’s a timesaver for Joomla hackers like me, seriously.
  • Plus, I have a really bad memory : DDDDD

joomla

Leave a Reply

Your email address will not be published. Required fields are marked *