Hi, this is only loosely relating to silverstripe and is probably much more a flash issue, but I thought I may as well try out the silverstripe community and see how I go.
Well anyway, I have a flash banner/gallery type object on my website which I am migrating to my new silverstripe website. At the moment the images, text, and links are hard coded into the fla and I have to edit it by hand when I want to make changes. Could someone point me in the right direction on integrating this into my site so that it updates based on the latest content? Or so I can control it from within the CMS?
Obviously the first step is getting the flash to load an xml file and read the items. Anyone know how to do this in a straightforward way or have some links to tutorials?
You can output XML from SilverStripe in various ways. One of the easiest is RestfulServer (http://doc.silverstripe.com/doku.php?id=restfulserver). It uses XMLDataFormatter, a utility class which might be helpful for you as well. And then there's the good old "make a new template with XML header" way ;) There's not much difference to creating an HTML template really. As for your banner, I'd suggest an image relation on your homepage in the CMS ($has_one Image), which you can then form into XML with a new controller method on Page.php
Hi. You can create a template for XML exactly the same way you would do for a regular HTML Page.
I suggest, you create a special method on your Controller that will output the XML Formatted Data.
Eg. in Page_Controller you would write:
Then you create a template for this method. Name it: Page_xml.ss and fill it with the following contents:
Now you should be able to access the XML Data, by appending xml to your URL. So if you have mysite.com/contact, you would use mysite.com/contact/xml in flash to access the XML Data.
This is a very basic example. You could also use $Layout in your XML Templates, or use the renderWith method to render some data with an "xml template". Although there are numerous ways to build a SilverStripe driven Flash site, the one outlined above is probably the easiest.