I have created a site map based on the tutorial. This site map works great. I want to add a checkbox to the CMS that will hide a page from the site map. I see that currently I can do it by page type like the tutorial hides the error page. However I want to be able to click a checkbox on any page to hide it. I have added
'HideInSiteMap' => 'Boolean' to the $db array and
$fields->addFieldToTab("Root.Behaviour", new CheckboxField("HideInSiteMap", "Hide from site map?"),'ShowInSearch'); to getCMSFields in the Page class.
This works and creates a table called Page which puts the page ID next to the ideInSiteMap column and does put a 1 or 0 depending on the value of the checkbox in CMS.
So far this all works as I had expected.
Now in the sitemap.php file I cannot figure out how to access the HideInSiteMap values in the Page table.
I tried
if(!($page instanceof ErrorPage) && $page->Title != $this->Title && $page->HideInSiteMap != 1)
But $page->Title works because it is getting that from the sitetree table not the page table.
So how do I access the page table?