fisharebest / webtrees

Online genealogy
https://webtrees.net
GNU General Public License v3.0
419 stars 290 forks source link

Hourglass Chart change default generations and spouse setting #4916

Closed photon-flip closed 6 months ago

photon-flip commented 6 months ago

I posted this on the webtrees forum but have had no help there :-( I'm trying to build a module to change the default generations and spouse setting of the Hourglass Chart. I've managed to do that based on the example-module-theme but that makes a whole new Hourglass Module.

I'd like to do it using the example-module to extends the AbstractModule and with that use my customized version of the HourglassChartModule with new defaults.
With Greg's help, I recently did something similar with the ImageFactory watermark - full module attached below. the key trick with that was the boot function. public function boot(): void { Registry::ImageFactory(new MyImageFactory()); } but this kind of mechanism doesn't work for the HourglassChartModule. I've tried looking at other modules but can't find examples similar that. Any hint would be helpful and much appreciated.

watermark-module.zip

fisharebest commented 6 months ago

The boot() function allows you to replace core code. The hourglass chart is a module, and one module cannot replace or disable another module. There is no logic to support this.

Instead, you'll need to disable the existing module in the control panel, and enable yours.

photon-flip commented 6 months ago

Thank you for that information. Knowing that will keep me from hitting my head against a brick wall and barking up the wrong tree and other metaphors over the holidays :-) My custom hourglass module will do the trick. I'll only use it on my local desktop installation. I am otherwise changing the settings every time I use the default one or having to remember to change it on the original module every update. Many thanks for your help.