Tell me more ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I am creating a drupal module that receives content from a Web Based XML API. The module takes some search parameters from a user and embeds these into a XML command. I am at the point where I am receiving back a response and am able to process the returned data and display it on the page using a simple return statement. At the moment I am simply returning a html table that is created in the module.

What I would like to do is make content available to other Drupal modules such as Views or Display Suite. But as this data is not coming from the database but being created on the fly I am not sure where to start. Any help would be much appreciated.

Thanks Simon

share|improve this question

Some pointers:

Try getting the data in your database somehow. You could import the data into nodes or you could use the Entity API. That way, you could expose your data to modules such as Views. The only thing you'll need to do left is to synchronize the data in your database with the XML data that you're receiving.

share|improve this answer
The problem is that the data is only valid for that user and contains price information that is only valid for 8 hours. Also part of the agreements with our supplier of the data is that we can not cache it, because the prices are so volatile. Thanks anyway and would appreciate it if this sparks any other ideas on how I may attack this problem. – PrestonDocks Sep 14 '12 at 17:52
I think that most of the modules rely on having data in the database, so if caching isn't an option I think you're pretty much screwed for integrating with a lot of modules. – Bart Sep 14 '12 at 17:55
I am thinking that I might go down the road of template files bundled with the module and use template suggestions in the module code. – PrestonDocks Sep 14 '12 at 17:57
That might be the best option indeed. I used to do it for a custom module but was able to switch to using Views etc. – Bart Sep 14 '12 at 18:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.