-
☆ A M B ☆
- 309 Posts
I have a custom date renderer that works perfectly, but currently I have it copied into the grid.renderer.inc.php file along with the other MIGX renderers, which likely will cause pain down the road when I update MIGX.
Where is the proper place to put a custom renderer?
the best way, is to create your configs (formtabs and columns) with the MIGX-configurator-CMP
In the MIGXdb - settings fill the field 'package' with a package-name,
example: 'mypackage' (allways all lowercase!)
Then create a file - folder:
core/components/mypackage/migxconfigs/grid/
with a file:
grid.config.inc.php
put your custom-code there.
Then you should be able to select your custom-renderer within the columns-definition in the MIGX-configurator.
-
☆ A M B ☆
- 309 Posts
Thanks Bruno,
Do I use the Package Manager tab first to create a package, and then use the MIGX tab to add an item and put the name of the package I just created into the MIGXdb-settings ? Or -- do I start with the MIGX tab and add an item and fill in the settings?
Also, do I need to make the TV first before I use the configurator?
you can use the package Manager tab to create the package.
But you can also just add that folder manually, since you don't need a xpdo-package.
In this case, it is just used to store your custom-files (can be custom configs, backend-templates, grids, processors)
then you create your grid.config.inc.php - file
then your configuration (in the MIGX - tab)
Then you put the name of your configuration into the 'configs' - field of your MIGX-TV and let formtabs and columns empty
In which order doesn't matter.
to have your custom-renderer in the listbox, where you can select the renderer for your column, you will need to create your custom-renderer in your grid.config.inc.php first and have added the packagename into the MIGXdb - settings - tab (save and reopen the config to see your renderer in the list)
-
☆ A M B ☆
- 309 Posts
Thanks Jako, that's very interesting. I've been meaning to start learning about Image+ too. Will have a go at both of these methods and report back!
-
☆ A M B ☆
- 309 Posts
Hi Bruno, I have not been able to get the new renderer recognized. Can you confirm that path where I'm supposed to put the new grid.config.inc.php file? You had said core/components/mypackage/migxconfigs/grid/
Is that correct?
What else should go into the new grid.config.inc.php file? Anything besides the new renderer?
Edit: I just tried making a grid.mypackage.config.inc.php file containing the custom renderer, and put this file in components/migx/configs/grid/. It works to get the renderer recognized and hopefully will not be overwritten by an update...?!
BUT - so far this package is not working. I can see the form correctly, and the column headings for the grid, but adding an item just creates a blank line in the grid. I must be missing something in the package but not sure where to look.
[ed. note: lucy last edited this post 11 years, 2 months ago.]
-
☆ A M B ☆
- 77 Posts
Lucy,
Did you have any luck with this? I am trying something similar with the GoogleMaps TV and was hope you may have some notes on how you got your custom TV to work with MIGX so I can see how to get that one to work.
Thanks
Ryan
-
☆ A M B ☆
- 77 Posts
Lucy,
Did you have any luck with this? I am trying something similar with the GoogleMaps TV and was hope you may have some notes on how you got your custom TV to work with MIGX so I can see how to get that one to work.
Thanks
Ryan
-
☆ A M B ☆
- 309 Posts
Hi Ryan,
I'm sorry to say I never did get it to work. I tried Bruno's suggestion, but could not get the custom package working. I did not try Jako's suggestion, because there was no budget left on this project for continuing playing around with it. So right now I have the custom renderer copied into the grid.renderer.inc.php file with a note to myself that I will have to copy it back after updating MIGX. Sorry I'm not more help.