Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

Cu3er and XML


Go to End


1827 Views

Avatar
Vladas

Community Member, 17 Posts

2 June 2010 at 9:10pm

I'm going to use Cu3er, which is a image slideshow on my website. It's going to have simple transitions between images so my XML config file will be pretty simple. Right now, I store all the images and configuration information in DataObject and edit it through ImageDataObjectManager. I want it to save it all to the XML file that is accessed by flash object on a site, so every single time I press Save and Publish, a file would be updated.

I know one way to do: in HomePage.php(that's where my cu3er flash object is held) write a function onAfterWrite() and there take all the data from database field and through standard php functions save it to the XML file

$xmlfile = fopen($currTheme . "/cu3er/config.xml", "w");
		fwrite($xmlfile, $finalresult);
		fclose($xmlfile); 

Is this is a good way or could you recommend me a better way please?