Hi,
I would like my SilverStripe templates to output XML that my Flash front end can connect to. It seems I've fallen at the first hurdle. Been reading other forum posts but they all seem to refer to getting only one object, and even so it just ain't working for me. It seems so simple, but I just can't crack it!
First things first: I have a Sector DataObject, and want to list them all in XML. So in my basic Page_controller I've got:
class Page_Controller extends ContentController implements PermissionProvider
{
public function sectors()
{
$sectors = DataObject::get('Sector');
if ($sectors)
return $this->customise(array('CarouselItems' => $sectors))->renderWith('Carousel');
return false;
}
}
Then I have a Sectors.ss file in my theme folder:
<carousel>
<% control CarouselItems %>
<item id="$ID" name="$Name">
</item>
<% end_control %>
</carousel>
I'm keeping it simple for now, but there will be more stuff to populate the item node in control block.
When I visit /home/sectors (home being the default page) I get a 404. I'm using 2.4beta-2.