Generate custom sitemap with userdefined priorities
Permalink
For my sitemap I need few pages to have pririty 1, for 2 or 3 pages priority 0.5 and for the rest somewhere between 0.6 and 0.9(maybe 0.8 for all of the other pages).
In the generate_sitemap.php (public_html/concrete/core/jobs) I have changed few things:
$changefreq = "daily";
$priority = 1;
$url = SITEMAPXML_BASE_URL . $instances['navigation']->getLinkToCollection($page);
if($url != "http://mysite.com"){
$priority=0.8;
$changefreq = "weekly";
}
And for first page all is right but I have never programed in PHP (only C and C++) and don't know what to write to do what I need.
To recap:
Front page and "mysite.com/somepage" need to have priority 1
pages that are beneath "mysite.com/somepage/" priority 0.8
and pages "mysite.com/anything_different_from_somepage" priority 0.5
In the generate_sitemap.php (public_html/concrete/core/jobs) I have changed few things:
$changefreq = "daily";
$priority = 1;
$url = SITEMAPXML_BASE_URL . $instances['navigation']->getLinkToCollection($page);
if($url != "http://mysite.com"){
$priority=0.8;
$changefreq = "weekly";
}
And for first page all is right but I have never programed in PHP (only C and C++) and don't know what to write to do what I need.
To recap:
Front page and "mysite.com/somepage" need to have priority 1
pages that are beneath "mysite.com/somepage/" priority 0.8
and pages "mysite.com/anything_different_from_somepage" priority 0.5
You can easily create an attribute like "sitemap_priority", then add a single line at the file \concrete\core\jobs\generate_sitemap.php to fetch page rank from this attribute.
"I have never programed in PHP"
@shahoq, what would that line of code be?
@shahoq, what would that line of code be?
Hi sir
May i help you on this? Please add me on Skype : tinkutr
May i help you on this? Please add me on Skype : tinkutr