Hi,

I've got a flash app in a content block that loads content from an XML file. I'd like Drupal to produce this XML file.

The XML file gives the location of the client's offices and looks a bit like this.

<places>
    <place name="London" theX="12" theY="12" url="/london" />
    <place name="Leeds" theX="5" theY="34" url="/london" />
</places>

So, is there a way to get Drupal to output XML and is there a way to make forms that a user can administer table like data?

Thanks for your help.

Comments

www.richardsprojects.co.uk’s picture

This must have been an unusual one as nobody got back to me.

I found a way of doing this and I thought other people might find it useful.

I used the CCK module to create a content type that had different fields. I created a Place type that had 'theX', 'theY', etc as fields.

I then created a Place for all the different places I wanted in my XML file.

I then used the Views module to create a page that displayed a list of all my places. I was then able to alter the template to make it an XML file.

Richard Garside
www.richardsprojects.co.uk

Mores’s picture

I also want to convert a view to an xml-file.
Can you explain how you did this?

Thx!

Bensbury’s picture

I've been trying to force the XML file to display custom fields but they won't appear in the RSS output.

Which version of Views and Drupal are you using?

The only way I know to dothis is to do the same as above but use the Contemplate Module and then alter the RSS template and force it to show CCK fields using an xml_format_elements function from the Drupal Api via PHP.

And for me............it doesn't work!

As far as I can find out that technqiue doesn't work for people using the latest Drupal 6 core.

MerlinofChaos from Views mentioned that currently Views2 doesn't support cck fields in the RSS view and that it would be something for the next version.

If you have it working in Drupal 6 with Views 2 I'd really be interested to know how you got the CCK fields to show up

anakcerdas’s picture

Hello,

I still don't get how you convert the views template to xml.
How do you do that?

Thx

Regards,

PITRA
www.media-ide.com

anakcerdas’s picture

Oh I get it.

You should use Views RSS to display all the contents.

If you use CCK fields (for ex: imagefield), you should also install Contemplate module, then activate "affect RSS output"
Also activate the RSS enclosure.

WorldFallz’s picture

another option: http://drupal.org/project/views_datasource

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

Bensbury’s picture

Hi,

A lot of people are looking for how to do this and there are no clear answers yet.

If you really want to have this feature please request it here:

http://drupal.org/node/316107

Hopefully with enough people we can get this to happen.
I see a lot of folk asking how to do this.