- Issue created by @mvelanka
- Assigned to flashwebcenter
- Status changed to Fixed
over 1 year ago 3:57pm 27 September 2023 - πΊπΈUnited States flashwebcenter Austin TX
Hello,
I have this hook (hook_form_BASE_FORM_ID_alter()) used in the theme file drupal8_w3css_theme.theme line 444. This hook will work only on node add or edit and if you don't see any changes, that's because you are not using the theme as an admin theme.You can create a custom module and use this hook inside it. recommended.
You can create a sub-theme to the active admin theme and you this hook inside. Not my choice.
You can use the w3css theme as an admin theme and you will see this code. Not recommended.I attached the sub-theme I used for testing.
Best wishes,
Alaa - Issue was unassigned.
- Status changed to Active
over 1 year ago 4:35pm 27 September 2023 flashwebcenter,
I hope I have understood this, that this hook will be used only if/when my theme is used as admin theme.
But then, the hook is still used from my base theme ..drupal8_w3css_theme, (even when that is not the admin theme either). I see that is getting used because the effect is to get the two column containerized node edit form. .. and also I could print a debug log message from drupal8_w3css_theme.theme file ... confirming that the hook is visited.
How does that work?
This got solved accidentally. See this comment in the drupal forum:
solved (accidently!!) β- πΊπΈUnited States flashwebcenter Austin TX
I saw the comment, my recommendation is to use a custom module. The node form is the form you use when adding content, whatever theme you are using in your-site-dot-com/node/add should have the hook. Here is an example in Drupal core: https://git.drupalcode.org/project/claro/-/blob/8.x-2.x/claro.theme?ref_... line 494.
Best wishes,
Alaa - Assigned to flashwebcenter
- Status changed to Fixed
about 1 year ago 12:28am 1 October 2023