We are currently working on a mobile app for a client for which we need to get the items of a category in a computer readable format (XML or JSON).
Similar to RSS feeds, it would be great if we could have the possibility of a configurable, raw XML or JSON output for both categories and items.
I was thinking this could be implemented by just adding some parameters to the URL, for instance:
Code:
http://domain.com/path/to/page?format=raw&type=json
Then I thought that it would be good if we could expand this to be a JSONP output by adding a callback parameter:
Code:
http://domain.com/path/to/page?format=raw&type=json&callback=myfunction
It would be great if we could select what fields are included. It would be great if I can have some custom output....
So, while I was thinking of this idea I thought of the following: what if I could assign to categories and content types one or more raw output templates? This would give us the flexibility to create new templates, we could use the structure we already have for templates where we can easily configure them through parameters, and select what fields should be displayed, and how the output should be built.
I will be happy to help with this idea. If you think it is good and easy to implement.