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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Working with XML and Database (CU3ER Slideshow).


Reply


1420 Views

Avatar
Vladas

Community Member, 17 Posts

19 February 2010 at 1:39am

Hello.

I've got a question about working with database and xml file. I've added a slideshow to my work, which reads data from XML file(it contains all the required information and URLs to files). More specifically - I'm working with CU3ER.

Now what I need to do is to be able to work with the images. My CMS is ready, and I'm able to add, delete, edit images to the database in the SilverStripe admin control panel.

The problem is that I want to connect CU3ER with the database. Should I use XML file as template and where images are defined, I should retrieve information from database?
If yes, then how, because I've tried to use DB:sqlquery, but it can't find DB class(I don't know how can I access DB class from separate php file).

Another way I thought of doing is to generate whole new xml file with entries of database(images) and save it in Page_Controller, so the CU3ER could read new XML file every single time the web is loaded.

Any ideas and how can I work this out?