Need a solution? Call Us Now!
1800 880 841

Joomla Coding Examples - Joomap

Joomap Component - Joomla SEO fix/patch to handle ChangeFreq, priority and lastmod for Joomap Version 2.0.5

Background
Joomap is a great component for creating a sitemap on your website.  It is also handy for generating a google sitemap which can be submitted to google.  The Sitemap generator is vital for google to map and find all of the files on your site correctly.  What Joomap does is allow google to find all of these links correctly.  I created this solution for my efforts in Search Engine Optimisation of Joomla.


The Problem
The problem with Joomap is that it does not have the changefrequency, priority and lastmod fields output in the sitemap XML file.  These modifications although not necessary and not included in the standard Joomap file do form a good improvement to the output of the filex XML.


The Solution
You need to locate the file "/components/com_joomap/joomap.google.php" and open it in a text editor.

Replace this code

                   $out .= "<url>\n";
                    $out .= " <loc>". $link ."</loc>\n";                        // http://complete-url
                    if( isset($node->modified) && $node->modified != FALSE && $node->modified != -1) {
                        $modified = date('Y-m-d\TH:i:s', $node->modified);        // ISO 8601 yyyy-mm-ddThh:mm:ss.sTZD
                        $modified .= sprintf("%+03d:00", $GLOBALS['mosConfig_offset']);    //TimeZoneDesignator
                        $out .= " <lastmod>". $modified ."</lastmod>\n";     
 
with the following code
                    $out .= "<url>\n";
                    $out .= "<loc>". $link ."</loc>\n";                        // http://complete-url
                    $timestamp = (isset($node->modified) && $node->modified != FALSE &&  $node->modified != -1) ? $node->modified : time();
                    $modified = gmdate('Y-m-d\TH:i:s\Z', $timestamp);        // ISO 8601 yyyy-mm-ddThh:mm:ss.sTZD
                    $out .= "<changefreq>daily</changefreq>";
                    $out .= "<priority>0.8</priority>";
                    $out .= "<lastmod>{$modified}</lastmod>\n";


Or you can download the full Joomap modified component here.

More about web development

Joomla Services

Joomla Brisbane
Joomla Web Design
Joomla Sydney
Joomla Melbourne
Joomla Designer
Joomla Design
Joomla SEO
Joomla Development
Joomla Perth
Joomla Developer
Joomla Company
Joomla Websites
 
Want to know more?Call 1300 880 841 or click here to contact us.

Featured Portfolio Websites

Sex Toys 24/7 website banner FRISKY ADULT SHOP