Hi Bruno, thank you for writing this! Tomorrow I'm going to try it out, I'll let you know how it works out!
Added some more Options to childresources - Tutorial today.
You will need the latest MIGX-Version for that, I've uploaded today, too (2.2.3 pl)
Hoping this can explain a little bit of the posibilities, which you have with MIGXdb.
It explains only a very small part of them.
I'm working through the tutorial. It worked fine up until the point where I click 'add childresource' on the resource with the migxdb tv, I get an error, see screenshot.
The error is:
Fatal error: Call to a member function getValue() on a non-object in /home/xxx/domains/xxxx/public_html/core/components/migx/processors/mgr/childresources/fields.php on line 32
(changed the domain name for security)
I'll try to reinstall migx and follow the tutorial again.
Another question, in the tutorial the configuration json contains a lot of backslashes \ . Is that supposed to be this way? (because in the original code that is in the configuration field there are no backslashes).
And I've also got a question concerning the migxdb CMP (for a custom table) which I was also trying: how can I get more tabs on the main CMP?
Thanks and I'll let you know if reinstalling fixes the error.
change this part in the file components/migx/processors/mgr/childresources/fields.php
to:
if ($includeTVs) {
foreach ($includeTVList as $tvname) {
if ($tv = $this->modx->getObject('modTemplateVar', array('name' => $tvname))){
$record[$tvname] = $tv->getValue($object->get('id'));
}
}
}
the TVs aren't created at this step, but they are registered by the included config-file, we work with on a later step
Another question, in the tutorial the configuration json contains a lot of backslashes \ . Is that supposed to be this way? (because in the original code that is in the configuration field there are no backslashes).
this is correct, its because of some nested jsons
And I've also got a question concerning the migxdb CMP (for a custom table) which I was also trying: how can I get more tabs on the main CMP?
you would create a configuration for each TAB and put in the menues parameters-field something like that:
&configs=configA||configB||configC
your configs delimeted by doublepipes
[ed. note: Bruno17 last edited this post 14 years, 2 months ago.]
I see the child resources I create are displayed in the tree, is that correct? Can I hide them from the tree?
Very easy.
go to the MIGX-Configurator and add a new field to one of the formtabs:
Fieldname: show_in_tree
Caption: Show in Tree
inputTVtype: listbox
inputOptionValues: no==0||yes==1
default: 0
You can also show the status of this field in the grid by adding a new column:
Header: Show in Tree
Field: show_in_tree
width: 20
Renderer: this.RenderCrossTick
[ed. note: Bruno17 last edited this post 14 years, 2 months ago.]
Finished the tutorial, wow, this is super handy!
I noticed a small thing, the toggle trash/not trash button is hidden underneath the filters, and there's a dropdown without any text in it. (all language settings are set to english).
hmm... it should look like that:
Hmm, strange! Will try to do everything from the start one more time later on, see if I did something wrong in the process. I'll let you know if it looks okay again.
If you have the time, I would also be very interested in some hints on how to show content from another db table in the childs grid (as a column in the grid).
I've got a simple star rating thing working. This is a separate table named modx_star_rating. In this table the field star_id corresponds with the id of the resource. The vote_total is divided by the vote_count to show the average rating. This number I would like to show in the grid, along with the vote_count. Showing it as stars would be even better, but that's for later maybe ;-).
I see all kinds of 'join' settings in the MIGX-configurator.. just not sure how to use them. I've attached a screenshot of the starrating table.
I was hoping if I could get this rating to show I would be able to show stuff from other tables as well (maybe more complex things like Quip).
I hope I'm not asking to much. Your help is much appreciated.