Data from new tables

We have been able to create a db source, but my knowledge tells me after doing the query, we have to the display the result set.


I have selected the data source and the fields I want displayed, but nothing in the manual or module documentation helps to deal with displaying the record set. From my past DreamWeaver development, I had to put place holders for the data and then make that a repeating field until the query is fully executed.



The table we created is inside of mysource_matrix db, should we create a new database for this content? It seems like this wouldn’t have an affect on the result set, but would be a direct issue when doing updates to the MSM system.



Any help is greatly appreciated.

To display the results of a data source, you need to use an asset listing. Set it up to list Data Source Record Set assets and set the root node to be the data source.


In the type format bodycopy, you can access the values of the fields using keywords in the form: %data_source_record_set_FIELD% where FIELD is the name of a column you selected in the query. You can normally find all the keywords on the Query Builder page of the data source asset (bottom of the screen when in execute mode).

It's best if you create a new db for non-matrix content. This way you won't accidentally break matrix. New tables won't interfere with updates.

[quote]New tables won’t interfere with updates.
[right][post=“10549”]<{POST_SNAPBACK}>[/post][/right][/quote]



Actually, it might – I’ve noticed that some of the step_02.php stuff breaks if there are non-Matrix tables in the database.

Is there a step by step example somewhere?


I can do what you're asking, but I get no results, nor errors?



So I know it is my own ignorance and something more detailed would be a great help.



Also, Avi we talked briefly about podcasting can we expand on that as well?



Thanks for your help and ideas.

I don't believe there is a step-by-step example for this specific situation – it should be the same as configuring any type of Asset Listing. The Data Source is just another source of assets to be listed (in this case, the Assets are rows returned from your external database).


I think you should give Squiz Support a call so we can talk about this one-to-one and get you sorted out.

A bit of debugging help: If you expand your Data Source in the asset map and see it's children, you can consider it configured correctly and be listable. If there are no children, then there's nothing to list.


Listing, then, works just like everywhere else, by specifying the Data Source as the root node. The keywords for use for each record set should be presented to you on the data source details screen because they're so dynamic, it's impossible at this stage to put them into the keyword drop-down list.



If you get no children of the Data Souce in the asset map, than either your query is wrong or you forgot to switch the mode of Data Source to 'execute', like Greg said. If your query is wrong, you can play with it on the command line, to make sure you've got it right, then copy-paste it into the query text box, bypassing the query builder.



If the query is correct, but you still get no results make sure you've got your connection right. If the db is on the different server see if the servers can see each other.



Hope this helps.



ps: if you want to discuss podcasting, start a new thread. Lets keep this thread just for data source issues.

[quote]To display the results of a data source, you need to use an asset listing. Set it up to list Data Source Record Set assets and set the root node to be the data source.


In the type format bodycopy, you can access the values of the fields using keywords in the form: %data_source_record_set_FIELD% where FIELD is the name of a column you selected in the query. You can normally find all the keywords on the Query Builder page of the data source asset (bottom of the screen when in execute mode).[/quote]





Good information. Thanks very much, it got my asset listing displaying some results.



What I would like to be able to do is dynamically set the root node of the asset listing. My asset listing works if i set the static root node to the DB Data Source asset, however I have a number of DB Data Sources I would like to display depending on a metadata field value on the asset listing asset. I have tried setting the dynamic root node via the Dynamic Parameters to the value asset_metadata_XXX and setting the static root node to the folder that contains the DB Data Sources but this does not work.



Any thoughts?



Cheers