Customize sitemap.xml

Permalink 2 users found helpful
I'm looking to change the update frequency and priority of some of my pages from the defaults of "monthly" and "0.5", but I can't find the settings for that. Any suggestions?

 
tcmfan replied on at Permalink Reply
tcmfan
Find in '/concrete/jobs/generate_sitemap.php':

if ($changefreq == '') {
                  $changefreq = 'monthly';
               }
               if ($priority == '') {
                  $priority = '0.5';
               }


You can hardcode some if-conditions there (if you need to change the defaults just for several pages), or maybe perform a complex customization to allow the editing of priority and frequency for each page individually.

Maybe, I'm wrong, but it seems, that there are no attributes "sitemap_changefreq" and "sitemap_priority" by default, even though there is a code checking for it:

$changefreq = $c->getAttribute('sitemap_changefreq');
               $priority = $c->getAttribute("sitemap_priority");
jacintos replied on at Permalink Reply
For now I'll take the easy route and hardcode what I need. Thanks for your help, tcmfan.
jacintos replied on at Permalink Reply
Strangely enough (that's how it always happens), I just figured out how to do it the right way. I came across this thread (http://www.concrete5.org/community/forums/customizing_c5/balloon_tips_on_the_title_of_a_webpage_and_custo) in which andrew describes how to create page attributes.

You just create text box page attributes (as andrew describes) for "sitemap_changefreq" and "sitemap_priority", which then show up as custom fields in the properties window. You add the fields to whichever pages you want to customise, regenerate the sitemap, and there you have it.
jacintos replied on at Permalink Reply
Link got screwed up. Trying again:

http://www.concrete5.org/community/forums/customizing_c5/balloon_ti...

Tinyurl in case that doesn't work:http://preview.tinyurl.com/8wmkcz...
BoundaryProducts replied on at Permalink Reply
BoundaryProducts
OK, I get the concept of the code in generate_sitemap.php for setting a priority to a listed page within the sitemap, but I'm not clear on how to assign a 'priority' attribute to a particular page.
I have read the above comments, but some of it goes over my head.
Any help would be much appreciated,
thanks
Peter
Tony replied on at Permalink Reply
Tony
sure, just go to your dashboard, to pages and themes, and then to the page attributes (might be under page types, or in its own tab as of 5.4). then create a new "select" type page attribute there. not sure what the different priorities are suppose to be, but you can search the web to find out.
kstrange replied on at Permalink Reply
kstrange
This does not work. I have no idea why, but after creating these two custom attribs which show up perfectly. It still sets it's own values. Crazy.
SigmaAlphaPi replied on at Permalink Reply
SigmaAlphaPi
Hi,

just did it, and it works fine. *thumbsup*


@kstrange: after you added the type, you've to add the field in each page's properties and assign your value to it.
kstrange replied on at Permalink Reply
kstrange
Yes, I'm aware of that. I think you may find disappointment in the coming days - I don't know how many pages or the layout of your site structure, but at the core it still doesn't work correctly.

I hope in your case it does, but I've found the reasons why, and they are definitely busted, I just engineeered a workaround hack and got to where I needed to go.....

Kev
RandomBrad replied on at Permalink Reply
RandomBrad
I just ran across this old thread today and wanted to post a link that helped me figure out this problem. Directions for any sitemap adjustment without any hardcoding.
http://www.joydeepdeb.com/blog/xml-sitemap-best-practices.html...