 |

Dennis de Rooy
User
Jan 22, 2008, 12:38 PM
Post #1 of 10
(1004 views)
Shortcut
|
|
Complete XML output
|
Can't Post
|
|
I was reading about someone managed to output data in xml for a mp3 player. I was wondering if it's possible to output everything in xml so I can use cms builder for a cms for Flash. I'm looking to use it for sites with an image gallery (with thumbs), a blog, mp3 player, .flv movie player and some text pages. Would it be possible to make these directories in CMS builder and that every directory outputs an xml with its content? Thanks, Dennis
|
|
|  |
 |

Dave
Staff
/ Moderator

Jan 22, 2008, 1:44 PM
Post #2 of 10
(999 views)
Shortcut
|
|
Re: [Dennis de Rooy] Complete XML output
[In reply to]
|
Can't Post
|
|
Absolutely! When you create your viewers just remove the HTML and replace with XML tags. Also, instead of the regular tag to display a field:
<?php echo $record['fieldname'] ?> use the PHP function htmlspecialchars() to encode the content as HTML entities so it's valid XML.
<?php echo htmlspecialchars($record['fieldname']); ?> If you need any help with this just let us know. We'd love to see a flash based site updated with CMS Builder. I think you might be the first. Hope that helps! :) Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

Dennis de Rooy
User
Jan 24, 2008, 12:25 PM
Post #3 of 10
(939 views)
Shortcut
|
|
Re: [Dave] Complete XML output
[In reply to]
|
Can't Post
|
|
Hi Dave, thanks for the reply, just what I wanted to hear. If I get CMS builder to output clean xml, I can build a flash site which content is created and managed by CMS builder. I'm going to give it a shot with the 10 day trial. I'll keep you updated on my progress. When I get the first working demo I can start building full sites. Cheers, Dennis
|
|
|  |
 |

Dave
Staff
/ Moderator

Jan 24, 2008, 1:36 PM
Post #4 of 10
(934 views)
Shortcut
|
|
Re: [Dennis de Rooy] Complete XML output
[In reply to]
|
Can't Post
|
|
Great, can't wait to see it. Let me know if you get stuck with anything. Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

aev
User
Jan 24, 2008, 1:37 PM
Post #5 of 10
(934 views)
Shortcut
|
|
Re: [Dennis de Rooy] Complete XML output
[In reply to]
|
Can't Post
|
|
Hi! I think you are referring to my post on the mp3/xml case I had. I just wanted to let you know that it is only possible to make "web-retrievable" xml output with CMS Builder not actual xml files on the web server's file system. This means that if your flash file reads it's xml data from a url like http://domain.com/content.xml and NOT from the filesystem like /your_web_root_path/domain.com/content.xml everything will work fine. Another issue is that unless you set your webserver to parse all files for PHP code you must name your xml files with a PHP extension. Like this: content.xml.php. In my case this was not a problem, but if the system/application reading your xml files is picky about extension it could be a problem. Using AM2's publish technology it would be possible to create actual xml FILES in your filesystem. But after using both I would definitely go for CMS Builder if you can use http urls for xml data in your Flash site. Dave, please correct me if I'm wrong on this.. maybe CMS Builder can do more than I know Regards, AEV
|
|
|  |
 |

Dennis de Rooy
User
Jan 24, 2008, 1:59 PM
Post #6 of 10
(927 views)
Shortcut
|
Thanks AEV for the heads up. You can use the php file to return xml and use that in flash. I have cms builder installed right now and I'm going to do the first run now. I'll keep you guys updated here. Cheers, Dennis
|
|
|  |
 |

Dave
Staff
/ Moderator

Jan 24, 2008, 2:04 PM
Post #7 of 10
(923 views)
Shortcut
|
Thanks aev, It's true, all the CMS Builders files end in .php and run through the web server. You can do things like .xml.php but they still end in PHP. If anyone needs to be able to access it through the filesystem or needs a .xml extension let me know. There's a few tricks with Apache .htaccess files and other things we could try to make that work. Try it the other way first, though. Hope that helps! :) Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

Dennis de Rooy
User
Mar 6, 2008, 12:02 PM
Post #8 of 10
(615 views)
Shortcut
|
|
Re: [Dave] Complete XML output
[In reply to]
|
Can't Post
|
|
Hi Dave, I finally have some time to get CMSbuilder to output XML. I changed the markup but where can I see the output pages? I can't seem to find the actual pages... Thanks P.s. If you need a peek at my files let me know
|
|
|  |
 |

Dave
Staff
/ Moderator

Mar 6, 2008, 1:46 PM
Post #9 of 10
(611 views)
Shortcut
|
|
Re: [Dennis de Rooy] Complete XML output
[In reply to]
|
Can't Post
|
|
You can generate a viewer code here: Admin > Section Editors > Your Section > Show PHP Viewer Code. Basically you just save that code in a file on your server such as: http://yourDomain/xmlPage.php You'll only have one file, but that one file will be able to output different content with different urls. So for example xmlPage.php?1 would load record 1, etc. The one thing you want to watch for, is since there isn't a .xml extension you'll need to send a header to tell the browser that it's XML. Just add this after your PHP tag:
<?php header('Content-type: application/xml; charset=utf-8'); Hope that helps. Let me know if you have any other questions or if you need more details. Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

Dennis de Rooy
User
Mar 10, 2008, 12:19 PM
Post #10 of 10
(581 views)
Shortcut
|
|
Re: [Dave] Complete XML output
[In reply to]
|
Can't Post
|
|
Thanks Dave! That works like a charm. Now I need to do the flash bit ;) I will post the results. Cheers, Dennis
|
|
|  |
|