Monday 17 January 2011 5:26:33 am
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 http://projects.ez.no/ggxmlview/ 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... ;-)
Principal Consultant International Business
Member of the Community Project Board
|