This site has been archived. To learn more about our current products Ibexa Content, Ibexa Experience, Ibexa Commerce head over to the Ibexa Developer Portal

eZ Community » Forums » Developer » Best practice to create XML used by...

Best practice to create XML used by embedded Flash slideshow

Best practice to create XML used by embedded Flash slideshow

Monday 17 January 2011 11:57:47 am - 7 replies

Hello eZ riders,

My client needs to embed flash slideshows in his pages. The slideshow class is a container and each of its children is a slide. It uses XML to be generated.

I am looking for the lightest way to create this XML. I have two ideas :

The first one is to use a new pagelayout.

The second one is to create a new module, changing the header and using eZExecution::cleanExit(); at the end.

Which one is the best solution ? Do you have another idea ?

Thank you very much.

Modified on Monday 17 January 2011 12:01:13 pm by Paul Etienney

Monday 17 January 2011 12:44:26 pm

What about an ezjscore ajax server call ? I only used it once but it was pretty simple to make a little AJAX module and though I used a JSON response, I think you can require XML format.

Check out this tutorial

Monday 17 January 2011 12:47:42 pm

Hello Benjamin,

Thank you for the suggestion. I keep it in mind. I would like to have other advices before choosing.

Monday 17 January 2011 1:52:46 pm

Hello Paul,

If your XML contents are not often updated, nor need to be always-up-to-date provided, I 'd suggest you to daily-generate your XML via a cronjob, using eZ PHP API + SimpleXML, & store it into a dedicated /var/storage/xml directory. That would be quicker to serve. Real time PHP-generated XML files hardly challenge Apache.

Modified on Monday 17 January 2011 1:55:24 pm by Ronan Guilloux

Monday 17 January 2011 2:26:33 pm

For this very simple use case, you'll be better of using an xml view of your contents. No need to touch a single line of php code (I know some devs prefer to do php rather than templates, but well...)

- use the layout/set module to create an xml pagelayout, to be served with the correct MIME content-type header

- create an empty template that will be used for 'xml' view of any content

- test it works: layout/set/xml/content/view/xml/2

- override usage of /node/view/xml.tpl for your gallery class, showing for it listing of children

- to make sure the view cache is generated for the xml view, change the value of CachedViewModes in config file site.ini.append.php

- if the generated urls are bit too long for you, use a wildcard url rewrite rule

You can also download the ggxmlview extension from and use it as starting point

Last but not least, there are some template operators used for json-encoding and xml-encoding available in the ezjscore extension

PS: I think this has been answered in the forums half a dozen times already... blunk.gif Emoticon

Modified on Monday 17 January 2011 2:27:56 pm by Gaetano Giunta

Wednesday 19 January 2011 12:05:08 pm

Hello Gaetano,

Thank you for this very complete answer. I think I will use your solution.


PS : My question was more a "What is the best practice ?" than a "How to ... ?". Be sure that i look for answer before asking questions happy.gif Emoticon

Modified on Wednesday 19 January 2011 12:06:53 pm by Paul Etienney

Wednesday 19 January 2011 3:14:32 pm

Well, my word is the de-facto best practice, of course! blunk.gif Emoticon

But since two different opinions had been given, I preferred to give detailed instructions on a different approach so that you would be able to compare and judge by yourself, rather than simply assert the merits of it...

Friday 31 May 2013 9:32:34 am

Hi, Paul. I think the easiest idea is looking for a flash slide show maker. With it, you can create xml flash slideshow, then embed the slideshow for use.


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from