Json/XML: List items and have a detail pages

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
HarmO
Forum Members
Forum Members
Posts: 246
Joined: Thu Jan 26, 2012 3:22 pm
Location: Belgium

Json/XML: List items and have a detail pages

Post by HarmO »

Hi,
I'm currently making a website where i have sync with an external JSON or XML file.

i have done this before for video's (like here), but now, there are multiple elements that complicate things.

A: pagination:
The json/xml file will list up to 250 items. We can't all put them on 1 page.

B: detail page
Now the customer wants a detail page for each item in the xml/json file with an url like http://www.example.com/video/video-alias

I'm thinkin for point B i need to make a detail page that loads a scipt. and with a htaccess rewrite i'll have to rewrite all links for "video/*" to use the detail page and give the video alias as a variable.

Then i just need to find out how i can do the pagination on the list.
any thoughts or experiences?
Kind regards,
HarmO
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Json/XML: List items and have a detail pages

Post by calguy1000 »

a: write a simple module that has summary and detail actions.
b: your module can register one or more routes to handle your pretty URLs
c: your actions can read the json/xml data on the server side instead of client side
d: your actions can use templates to render your summary and detail views.

The only difference between this module and any other module is that instead of retrieving data from the mysql database you are retrieving it from a json/xml or other source.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3322
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Json/XML: List items and have a detail pages

Post by velden »

You might consider using LISE as the module and write your own procedure (e.g. UDT) to sync the xml with LISE items. This task then could be run as a pseudo cron job or perhaps you can use real cron to request a 'hidden' page including the UDT.

Pagination can also be done using e.g. jQuery I presume but might be less efficient (client side)

https://stackoverflow.com/questions/250 ... -json-data
HarmO
Forum Members
Forum Members
Posts: 246
Joined: Thu Jan 26, 2012 3:22 pm
Location: Belgium

Re: Json/XML: List items and have a detail pages

Post by HarmO »

In both cases there is development work involved.
I think the creation of a basic module would be the most logical to do.
Kind regards,
HarmO
Post Reply

Return to “The Lounge”