Hi all,

I want to setup a drupal backend for a flash site to manage some of the info. The flash front end is at www.janelaurie.com and the backend is at www.janelaurie.com/cms (both VERY WIP).

Basically I just want to read the portfolio images from the CMS into flash and at the moment I'm doing it by publishing my portfolio views to RSS (using contemplate module) and reading that into flash as XML (xmlJPGs.load("http://www.janelaurie.com/cms/portfolio/feed?filter0=" + iCategory))

It works fine however it is pretty damn slow (for the flash site to load the RSS XML) and I dont think it is the best way to do it perhaps. Does anyone have an idea what the quickest way to do this would be? I have a VERY tight deadline so I did it this way, I guess I could query the database directly but I have no idea what is in what table, and because its a custom CCK nodetype (one image for the main image, custom image for the thumbnail etc.) i guess I would have to query different tables and join and stuff which I don't really know much about....

any ideas and suggestions welcome...

Comments

high1memo’s picture

so no one has any tips for flash front ends to drupal backend?

steveelbows’s picture

I was just trying this sort of thing for the first time at the weekend. Use the services module and the amfphp module. Theres a tutorial here that got me started: http://drupal.org/node/140893

I had to use the first beta of amfphp 1.9 beta 2, not the later may one, or else I got errors, but maybe thats just me.

This site had some info about how to get amfphp performing much faster, if its still too slow for you: http://www.5etdemi.com/blog/archives/2007/01/amfphp-19-beta-2-ridiculous...

I dont know how this method compares to the XML stuff you have tried, in terms of performance.

high1memo’s picture

I haven't tried steves suggestion with the amfphp module - which I will do when I get a chance... but in the meantime I've had a few questions on what exactly I'm doing in my method, so I'll briefly describe the drupal side of things - which is very straightforward!

I'm using the CCK module with CCK Image field, the Contemplate module, and the views module. I am not using any other modules (not the image module, image gallery or anything).

1. I created a new CCK type (portfolio_item) which has a title and body (standard CCK fields) and then TWO image fields. One for the thumbnail, one for main image. The reason I did it this way is because I want the thumbnail to be a different picture than the main image - so I didnt use any automatic thumbnail generating modules (image module, imagecache etc.)

2. I created a very simple taxonomy structure and assigned to portfolio_items - actually its hardly a structure, just a simple list! taxonomy vocabulary: 'Portfolio' - terms: 'narrative, promotional, sketches, misc'.

3. Using Views module I created a 'portfolio' view (http://janelaurie.com/cms/portfolio) which has an exposed filter for the portfolio term (so you can see when viewing in html) and also RSS: RSS FEED Selector added as an argument to the view (with value set to 'Display All Values'). You can see the effect of this filter by adding an argument to the url, e.g. http://janelaurie.com/cms/portfolio?filter0=2.

4. You can view the RSS feed by adding 'feed' to the url http://janelaurie.com/cms/portfolio/feed?filter0=2

5. The fields displayed for each node in the RSS is not related to the fields displayed in the view. In my Views I had it setup as a table, showing only the thumbnail, title and taxonomy. For the RSS we need different data, thats where the contemplate module comes in. With that you write a little phpcode to tell drupal what to display for teaser, body and RSS (more info on the contemplate page). So my RSS code is simply:

<?php print $node->field_main_image[0]['filepath']."|" ?>
<?php print $node->field_thumbnail[0]['filepath']."|" ?>
<?php print $node->content['body']['#value'] ?>

The title is automatically added, so I just dump the urls to the images and the body. When parsing the XML in flash all this data appears in one tag so I use the '|' character to seperate the info. (If anyone knows a better way to do this would be appreciated).

6. In flash I call xmlJPGs.load("http://www.janelaurie.com/cms/portfolio/feed?filter0=" + iCategory) and parse the XML. I'm not gonna go into details on that cos its just standard flash xml parsing... loads of tutorials on the web for that.

So thats it basically, if anyone has any suggestions they are more than welcome...

Bensbury’s picture

Hi,

A lot of people have been asking how to do this and there are no real answers.

Views2 RSS and CCK doesn't show custom fields in the RSS XML output.
People use the Contemplate Module to try and force the CCK fields but they don't return as XML elements (at least for many of us)

The best way to get this to happen is to go here and add your comments to get it a priority feature request.

http://drupal.org/node/316107

Hopefully the right people will see it and either at the feature or a clever chap will provide a patch.

This is for Drupal 6 by the way.