I wish to know how to reference a specific formtab of a master tv within a formit call. I AM able to do this successfully with a Numerical Template Variable directly associated to the Template I’m using. I get a clean numerical entry into a simple TV on resource creation. However I’m not sure how to specifically reference the same TV when it is included in a Master MIGX config formtab. I wish to insert several 3 digit temperature values into a migx tv grid on Resource CREATE from a front end formIt.
The main TV with the MIGX config is: temp_core
the formtab field is: tmp1
the formtab field references the TV: temp_onenumber
The FormIt Call:
[[FormIt?
&hooks=FormIt2Resource
&preHooks=Resource2FormIt
$resource2formitfields=pagetitle,content, temp_core.tmp1
]]
the form HTML in question:
<label for="temperature1">
tmp1: [[fi.error.temp_core.tmp1]]
The question really is does [[+fi.temp_core.tmp1"]] reference the tmp1 field in the MIGX table temp_core on the Template I’m using?
So based on your clue and some googs I am thinking I can augment the hook script to grab the json array corresponding to the TV I’d like to edit, build my new array to push on, and then re-encode the json before overwriting the original value. Adding these lines before the document save in FormIt2Resource.
$tempArray=array(json_decode($doc->get(‘temp_core’)));
$tempArrayLast=end($tempArray);
$migxid=$tempArray(‘MIGX_id’)+1;
Atrocious?
is this generic method useful in modx / migx specifically. I didn’t see that you included the link there to that older post, I will see how far off I was.
Give me a bit to tweek my monstrocity to reflect these clean examples
Much appreciated, I had some wonderful realizations about the backend process by attempting this senario with your advice. now it is apparent to me, the database solution is critical. Thank you. I created a new table in mysql and then attempted (without success) to autmoatically create the schemas and configs with db2formit as well as an attempt with createXpdoClasses. I’m in the process of following Bobs guide for custom database. I can tell each path I choose will require a great deal of learning, which I expect is inevitable. So in the mean time, do you have a prefered method for adding a custom database? Is the bobs guide timely?
So it seems there are multiple ways to accomplish this integrating a custom database table, so my question is there a most common approach I should focus on. Any additional tips to keep me on the right track?
Wow how’d I miss this guy. Bass ackwards as usual I am. I must prefer the hard way. This is the most productive conversation I’ve had in months, thank you so much for your contributions. I’ll dive in and share my results.