320 Posts in 91 Topics by 154 members
Page: 1 2
|Go to End||Next >|
18 February 2009 at 9:11am
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?
All feedback appreciated - thanks
24 February 2009 at 8:49pm
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
16 May 2010 at 12:17am
Is there any example of how this is done? or just a simple example of what an XML template looks like?
16 May 2010 at 4:42am
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:
<?xml version="1.0" encoding="UTF-8"?>
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.
16 May 2010 at 3:12pm
Hi Thanks, that was great!
Is there any extension out there that edits XML like row by row similar to a table view?
<title>Minutes to Midnight</title>
where I can allow the client to add in extra album titles? Because $content will do it in a big bulk right?
17 May 2010 at 8:17am
Model-Admin is indeed a possibility. In most cases, the DataObjectManager Module is the best tool for tasks like this. It allows you to edit DataObjects right in the Content area of the CMS.
29 June 2010 at 7:22pm
There is an example on ssbit site, too.
Page: 1 2
|Go to Top||Next >|