Hi guys,
I'm a bit of a newbie with Drupal, but have jumped into the deep end to try and make a very dynamic, data intensive site using the data module. I am looking for some high-level advice regarding the strategy for achieving the outcome I am after. Maybe you guys can help give some guidance based on your experiences using Data....
Basically, I am trying to create something like www.afghanistanelectiondata.org, but for economic data for a city in Australia. The aforementioned site makes heavy use of the data module, I think.
So far I have imported a table of data that includes economic data for each district in a city. This is in a table called 'econdata-districts'
I have been a able to create a page that lists each of the districts, this was achieved using the views module, based on the data table. Very easy.
What I haven't done is create the pages for each of the districts. Ideally I would like only one page (node), that will dynamically load economic data for a district based on a argument in the site URL, from the 'econdata-districts' table. For example if I go to the page www.citydata.gov.au/district/$districtid - it will load data from the table where the unique id = $districtid.
Ideally I would want it to load each data item that exists in the table for the district into variables at the beginning of the page - eg. $employment, $taxreceipts etc. I could then utilise these however I see fit in the page... , including graphing with flot, text, tables, comparisions etc.
Basically I have two questions - Am I going about achieving this outcome in the right way, using Data? Secondly, if so, what PHP code would I need in the page (node) to load data from the data table given uid=$districtid, where $districtid is derived from the URL?
Your help is much appreciated.
Regards
Matt
Comments
Comment #1
fletch11 commented+1 - this is exactly the type of example that could really benefit from some additional documentation - particularly regarding views integration. I'm doing something very similar but am having a hard time relating a table to a related node. Help would be greatly appreciated.
Comment #2
natkeeran commentedI am in a similar situation. It seems to make sense to pull the data from the database, and use it in the drupal page. You can retrieve the argument arg(0), and execute the php with input format being php. If need be
drupal_add_js(' ca be used to add graphics or js effects.
The issue for me is search. I would ideally like to search through all the data corresponding to all the ids. But, with the above method, I have not figured a way to do that.
Comment #3
joachim commentedYou don't need nodes. You need a menu item whose callback accepts an ID for your data row. Load that item up, and then generate output based on it.