Json Data Source


(Waddy707) #1

I'm trying a number of ways to nest the return 'data source record set', of course details, nested as content within it's respective course details page (std page asset).

 

I can directly link the 'data source record set' e.g. course code MN4535 into it's respective course details page which has a metadata field with course code, by direct linking the appropriate 'data source record set' and using a paint layout to display on page.

 

However what happens if a new course get's listed which has a course code that is alpha numerically placed somewhere in the current order , I assume the order will get re-indexed thereby the nested links will be pointing to the wrong course details 'data source record set'.

 

Therefore I'm trying to set a dynamic 'get' parameter that can use the course code to filter or return only the course details 'ds record sets' for that course code.

 

I've tried this on the 'asset listing' & 'search page' (can't get shadow assets attributes on ds record set format type), so am trying to use the filter & dynamic input screens of the 'Json Data Source' asset as per screen shots attached.

 

Can someone advise if this is possible (as I can't get it to work) or if there is a better approach?

 

Thanks. json_data_source_record_filter.png (99.7 KB) json_data_source_details_btm.png (318 KB) json_data_source_details_top.png (400 KB) json_source_dynamic_inputs.png (108 KB)


(Anthony) #2

Rather than try to build the whole page in one go with nesting, could you have a bit of jQuery to AJAX in the dynamic section when the page loads?

Alternatively I also remember seeing a good example on the forums somewhere that explained how to effectively do a search on a CSV data source and return just the record you need. That might give you a clue cos I think all the data source's work similarly?


(Waddy707) #3

Thanks for this, Anthony. This was exactly what I needed.

 

For those that are interested the CSV data source example is here  http://forums.squizsuite.net/index.php?showtopic=11377&hl=%2Bcsv+%2Bdata+%2Bsource+%2Breturn+%2Bone+%2Brecord

 

And this applies to the JSON Data Source and probably others as well.