Jump to content

Integration code help


Christopher Ambler

Recommended Posts

Okay, I'm in the process of writing integration code for my gallery component. I plan on using JReviews to implement a critique system for images. Here are my open questions right now:

 

Every image has an entry in a table (jos_mi_images) that holds all of the information about the image. One field is "critique" which can be a value of "none" or "comments" or "detailed"

 

What I would like to do is use this field as the criteria to determine which field group is used for the review. If "none," I simply don't call the integration code. If "comments," I would use a field group that has very generic fields. If "detailed," I would use a field group that has fields with detailed critique information.

 

So I'm looking at the files in /jreviews/controllers/components/everywhere and trying to get an idea of how it's done. As far as I can tell, the real work is done in how "fields" and "joins" and "joinsReviews" are crafted, but I can't find any documentation on this. Am I just not looking in the right place?

 

It *APPEARS* that "joins" needs to bring in a row from a table that contains the field that controls this decision (AS Category), but I can't seem to find out how this is consumed or how it must be formatted. My best guess is that it's consumed in the "fields" array, but then I can't figure out how that array is then used.

 

It also appears that what I really want to do is create a new table for my gallery component, perhaps call it CritiqueCategory, and have it hold the different kinds of critiques, and use this as the Category table, above. I see that the K2 plugin uses #__k2_categories for connecting-up the article categories to the review listing type. So I'd want to mimic this behavior to link-up my different Critique types to the different review listing types for each one?

 

See the dilemma? The example code makes sense, but there's no "here's how you get from start to finish" in building one of these integration files.

 

I hope there's documentation on this that I'm just not finding?

Link to comment
×
×
  • Create New...