Jump to:

324 Posts in 153 Topics by 156 members

Migrating a Site to Silverstripe

SilverStripe Forums » Migrating a Site to Silverstripe » Incorporating Flash with Dynamic Content

What you need to know when migrating your existing site to SilverStripe.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 5170 Views
  • Ctrl+Z
    Avatar
    Community Member
    9 Posts

    Incorporating Flash with Dynamic Content Link to this post

    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

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: Incorporating Flash with Dynamic Content Link to this post

    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

  • RolfChen
    Avatar
    Community Member
    6 Posts

    Re: Incorporating Flash with Dynamic Content Link to this post

    Hi,

    Is there any example of how this is done? or just a simple example of what an XML template looks like?

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Incorporating Flash with Dynamic Content Link to this post

    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:

    function xml(){
       return array();
    }

    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"?>
    <page>
       <title>$Title.XML</title>
       <content><![CDATA[
       $Content
       ]]></content>
    </page>

    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.

  • RolfChen
    Avatar
    Community Member
    6 Posts

    Re: Incorporating Flash with Dynamic Content Link to this post

    Hi Thanks, that was great!

    Is there any extension out there that edits XML like row by row similar to a table view?

    e.g.
    <album>
    <title>Meteora</title>
    <title>Minutes to Midnight</title>
    </album>

    where I can allow the client to add in extra album titles? Because $content will do it in a big bulk right?

  • bartvanirsel
    Avatar
    Community Member
    88 Posts

    Re: Incorporating Flash with Dynamic Content Link to this post

    you could use modeladmin, i recommend reading this: http://doc.silverstripe.org/modeladmin

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Incorporating Flash with Dynamic Content Link to this post

    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.

  • biapar
    Avatar
    Forum Moderator
    435 Posts

    Re: Incorporating Flash with Dynamic Content Link to this post

    There is an example on ssbit site, too.

    5170 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.