Monday, October 25, 2010

Canonical link for joomla

I created a plugin that will allow joomla to specify article canonical link
the plugin will Add <link> tag to the head of the document

<link rel="canonical" href="product.php?item=swedish-fish" />

To specify your canonical link using this plugin. Use the syntax below:

{set_canonical_url value=http://domain.org/your_page.html}

Use this code inside your content.

download the plugin here: canonicalurl.zip



Thursday, October 21, 2010

Dynamic page titles for mighty resource article listing

For SEO purposes duplicate page titles is a headache the following hack will solve the problem.

open the file:


components\com_resource\views\list\tmpl\default.php

in line 50 add the following code:


                    /*START: Page title override */
                        $doc =& JFactory::getDocument();
                       
                       
                        $meta_description = $doc->getMetaData("description");
                        $meta_keywords = $doc->getMetaData("keywords");
                       
                        $Unique_page_title =  $doc->getTitle()." ".$pages;
                       
                        $Unique_page_description = $meta_description." - ".$pages;
                       
                        $Unique_page_keywords = $meta_keywords.",".$pages;
                       
                       
                        $doc->setTitle($Unique_page_title);
                       
                        $doc->setMetaData( 'description', $Unique_page_description );
                       
                        $doc->setMetaData( 'keywords', $Unique_page_keywords );

                       
                    /*END: Page title override */

the above code will generate unique page titles, description and keywords to your article list pages. example "Category Name Page 1 of 10".


Now search engines can index your article listing by page.

Note you can customize the code above by modifying the  $Unique_page_title variable.

Enjoy!

Changing page titles in joomla using the API

Using API15:JDocument/setTitle

Initialize Joomla Page Document Variable

$doc =& JFactory::getDocument();

then use the code below

$doc->setTitle("Your page title here");


Notes:

API15:JDocument/setTitle  - Sets the title of the document

Syntax:

setTitle($title)


Parameter Name Default Value Description
$title
$title public

Monday, October 18, 2010

Tip: Secure your Joomla sites before they are hacked!

Phil Taylor published this Tweet today:
A lot of people getting old versions of #joomla 1.5 hacked
today - been fixing sites all day for customers...
UPGRADE NOW to #Joomla 1.5.10
I couldn't say it better myself. It's crucial that you upgrade to thelatest version of Joomla.
When you've done that, there are several other actions you can and should take to avoid being hacked:

Joomla Tip - Why does some HTML get removed from articles in version 1.5.8?


In Joomla! 1.5.8, a default filtering choice is in place for those who have not selected an Article Filter option. The default applied for those who have not made a selection implements "black list" filtering as a security precaution against possible XSS.
Due to this change, you might notice problems trying to save a Youtube video, or embedding other Javascript or Flash objects into your Articles.