How Can I Create an XML to Create a Menu?

How to create a PHP file that returns a list of nodes as XML?

  • How do I create a PHP file that returns a list of nodes as XML when called if I have a menu structure like this: <GalleryXML> --gallery 1 ---Item 1 ---Item 2 ---Item 3 And I want a url like localhost/getgallery.php this url will then return my gallery as xml, something like this <galleryXML> <gallery name="gallery1"> <item name="item1"> <image>localhost/site/default/image1</image> <imagethumb>localhost/site/default/image1</imagethumb> <url>http://google.com</url> <description>lorum ipsom</description> </item> </gallery> </galleryXML> Where Image, Imagethumb, url and description are fields on the item node Thanks in Advance!

  • Answer:

    This is what i did: I created a view. Changed the style to XML data document (Need to download the http://drupal.org/project/views_datasource module) Added the fields I needed and http://drupal.org/project/nodequeue Added a filter to filter by node type so it looks like this: then I added a new page with a path: my end result looks like this: <node> <node> <Description>blablalbla</Description> <Image> sites/default/files/articles/siteadmin/test.png </Image> <ImageBig>sites/default/files/test.png</ImageBig> <Link>derp</Link> <gallery>Gallery1 For flash</gallery> </node> <node> <Description>sdfsdfdf</Description> <Image> sites/default/files/articles/siteadmin/test.png </Image> <ImageBig>sites/default/files/test.png</ImageBig> <Link>sdfdf</Link> <gallery>Gallery2 For flash</gallery> </node> </node>

Kim at Drupal Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.