Registering Custom Widgets

Posted in: Newspaper
Post count: 108

Hi Guys, I’ve registered custom modules and blocks in td_config.php and this is all working fine, my question is how do we then get these to appear as sidebar widget options in Appearance>Widgets?

Thanks
Matt

Post count: 20688

Hi,

This is where the theme blocks and widgets are registered
https://www.screencast.com/t/PJiUTY4yI
If you enter your blocks there, they should be displayed in the widgets section.

Thanks

Post count: 108

Hi Simion, thanks for that, that seems to have done the trick, I do however have a related issue with the registered params for custom blocks.

I used Block 10 as a base for my own custom block so everything should be the same, however, in page builder and now as a widget the params are completely different with a number of them missing? Please see the attached image.

Instead of ‘General – Filter – Ajax – Extra’ my custom block has ‘Filter – General – Ajax – Extra’ with a number of the ‘General’ params missing, Custom Title, title colour, head template etc, am I missing something?

Params Issue

Post count: 20688

Hi,

I have tried adding a new block through the api plugin
https://www.screencast.com/t/5oIlVD0C
And registered it as a widget
https://www.screencast.com/t/MRD17ICI3M5T
There seems to be nothing missing from the general tab settings
https://www.screencast.com/t/g35Z3JjNBS5
The parameters in your code seem to be valid, including the general options
https://www.screencast.com/t/Duvfl6V1
Maybe double check all the code, or if you made any other modifications to the theme files.

Thanks

Post count: 108

Hi Simion, after much experimentation I managed to figure out what was causing the issue.

I simply had to move the position at which the new modules and blocks were being defined in the td-config.php file, I had all custom definitions at the top of the file which was working fine apart from the params for widgets and blocks, all sorted now however and I’ve moved them to the relevant sections within the config file.

Matt

Viewing 5 posts - 1 through 5 (of 5 total)
The forum ‘Newspaper’ is closed to new topics and replies.