12 days ago
adminsforum@hubzilla.org
Scott M. StolzScott M. Stolz wrote the following post 12 days ago

PDLs and Addons

It seems to be ignoring the mod_example.pdl file in custom addons.

Based on the addons in the official addon repository, the pdl file for Mod_Example.php should be mod_example.pdl, right?

And if you want to set a different php template, you would add [template]doubleleft[/template] to the PDL file at the top. Correct?

Do I have to do something special to get it to use the addon's pdl file?
12 days ago
scott@codejournal.dev
Okay, small setback. Apparently the pdl only applies to the main module, and not to any other modules within the addon.

This is a problem.

And looking through the addons, it looks like we are the only person who ever tried to use a pdl file on multiple modules within the same addon.

It might be the case that the core does not support this. O.o
12 days ago
harald@hub.volse.no
@Scott's Code Journal You could always hook the alter_pdl hook, which get's whatever layout the system has decided for you in the layout key in the array it receives. You could just replace that with the content of the pdl file you want to use. This will be the pdl that is passed to Comanche.

It's a bit of a cludge, but I think it should work.
12 days ago
scott@codejournal.dev
@Harald Eilertsen Thank you.

I think we finally figured it out. Apparently there is a load_pdl hook.

Hook::register('load_pdl', 'addon/custompage/custompage.php', 'custompage_load_pdl');

And you have to load it for every submodule in the addon.

#^ https://framagit.org/federated-works/neuhub/hubzilla-addons/-/blob/dev/custompage/custompage.php?ref_type=heads

Note: dev version; work in progress; subject to change.
Sorry, you have got no notifications at the moment...