Need to try to illicit a response or some ideas for my final database publish issue.
Client has a 4-level hierarchical checkboxtree control. In order to make this control do what we wanted we needed to save, for each selected node, any parent nodes. Also, we wanted to allow the save of only one single selection at any level of the hierarchy, again saving each parent node. I did this through the use of triggers on database insert/update.
So imagine I have a content item, contentid 1111, revision 1. The table that saves the checkboxtree selection has a column called codeitem. Then from the selected codeitem I derive values for columns itemlevel1, itemlevel2, itemlevel3, itemlevel4 - here there is potentially more than one row per content item. In another table I save one single row per content item, storing itemlevel1, itemlevel2, itemlevel3, itemlevel4 (generally the row stored is the last one selected in the CBT).
So if I have a hierarchy like:
A1
- B1
- C1
- C2
- C3
-D3
-D4
The multiple row table for my content item looks like this (assuming C1 and D3 have been selected for the content item):
And the single row table looks like this:
So I want to bind each single (itemlevel*) value from the second table to my db publish template as a single value and write these to the database.
And I want to bind each multiple row itemlevel* from the first table to my db publish template and publish these to a child table.
For the single values I’m playing with a $rx.db.get to bind to a single variable but don’t see how to get my contentid and revision into the query.
For the multiple values I’m wondering on the best way forward - adding a sys_addChildInfo exit to the content type to append these fields and then processing them as an array in the template bind (which is proving difficult for me to fathom, especially since as reported in another post the debug mode errors when it tries to display a simple child), or do another $rx.db.get into an array? But the mapper seems to handle proper child fields but not simple children…
Any advice or ideas hugely appreciated!
Andrew