Hi Aron,
I just reread your original post, I am not sure why you are using $belongs_many_many?
In order to get a list of pages (that is selected in the cms) to render on a page, all I do is:
In mysite/code/Page.php
class Page extends SiteTree {
public static $db = array();
public static $many_many = array(
'LocationList' => 'SiteTree'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab( 'Root.Content.Main', new TreeMultiselectField( 'LocationList', 'Box Questions', 'SiteTree' ) );
return $fields;
}
};
class Page_Controller extends ContentController {
public function init() {
parent::init();
}
}
Then in my themes/themename/templates/layout/Page.ss
<ul>
<% control LocationList %>
<li><a href="$Link">$Title</a></li>
<% end_control %>
</ul>
Is this not what you want to achieve?