Skip to content

refactor: migrate config form to Twig template - #340

Open
giovanny07 wants to merge 1 commit into
pluginsGLPI:mainfrom
giovanny07:feat/migrate-config-form-to-twig
Open

giovanny07 wants to merge 1 commit into
pluginsGLPI:mainfrom
giovanny07:feat/migrate-config-form-to-twig

Conversation

@giovanny07

Copy link
Copy Markdown

Replaces the raw HTML echo statements in PluginTagConfig::showConfigForm() with a Twig template (templates/forms/config.html.twig) using Bootstrap 5 card layout and fields_macros, consistent with the rest of the plugin's
GLPI 11 forms.

No functional changes — only presentation layer refactor.

Comment thread templates/forms/config.html.twig Outdated
<h3 class="card-title">{{ __('Tag Management', 'tag') }}</h3>
</div>

<form method="post" action="{{ form_action }}">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

With Twig, you don’t need to manually handle the <form> DOM.
You simply need to add the following line at the top of your file:

{% extends "pages/setup/general/base_form.html.twig" %}

This will automatically manage the form structure, including the “Save” button.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks @stonebuzz, sorry for the delay. The template now extends pages/setup/general/base_form.html.twig and only fills the config_fields block, so the form, CSRF handling and Save button come from core. I also rebased on main to clear the conflicts. Checked on GLPI 12.0.0: the tab renders and saving tags_location persists.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

There has been no activity on this pull request for 90 days and therefore it is considered stale and will be closed automatically in 14 days. Feel free to add a comment or push new commits to keep it open.

@github-actions github-actions Bot added the Stale label Nov 6, 2026
@giovanny07
giovanny07 force-pushed the feat/migrate-config-form-to-twig branch from ec7baae to f46fe0d Compare November 17, 2026 23:25
@github-actions github-actions Bot removed the Stale label Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants