Skip to content

Conversation

Axel35000-tech
Copy link

Checklist before requesting a review

Please delete options that are not relevant.

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.

Description

  • Add hook to add new variables in answers template (followup, solutions, etc.)

Copy link
Member

@cedric-anne cedric-anne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

Thanks for the contribution.

  1. This should be made in a generic way.

For instance, to get additionnal parameters, you can do something like that in the TemplateDocumentation class, to make the plugin being able to define additional parameters for all the supported object types.

$additionnal_parameters = [];
foreach ($PLUGIN_HOOKS[Hooks::SHOW_ITEM_RESP_PARAM] as $plugin => $hook_callable) {
    $plugin_parameters = Plugin::doOneHook($plugin, Hooks::SHOW_ITEM_RESP_PARAM, $parameters_class::getDefaultNodeName());
    if (is_array($plugin_parameters)) {
        array_push($additionnal_parameters, ...$plugin_parameters);
    }
}
  1. The naming is not correct. These hooks will be used to add additionnal user templates nodes, so something like get_content_template_parameter and get_content_template_value would be more appropriate.

@cedric-anne cedric-anne added this to the 11.1.0 milestone Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants