- Issue created by @mlncn
- πΊπΈUnited States mlncn Minneapolis, MN, USA
Wanted to note that there is no mention of this primary / secondary (kebab menu) distinction in gin.api.php, and while it may be a different sort of thing than a classic API that's still a good place to document or point to other documentation.
Also i can see that
$form['actions']['submit']['#button_type'] = 'primary'
but changing this value and setting other actions to primary does not affect anything Gin does.Now that themes can declare dependencies on modules β , could we make a tiny, low-weighted module that Gin depends on that sets 'primary' to the actions that Gin thinks should be outside the kebab 'other actions' menu? Then regular-weight modules could further form alter this easily.
- πΊπΈUnited States mlncn Minneapolis, MN, USA
The merge request in π Cannot opt out buttons using #gin_action_item = TRUE Active restores an ability for third-party code to place buttons to the emphasized area outside of the kebab menu by adding in a form alter hook:
$form['actions']['example_button']['#gin_action_item'] = TRUE;
So as things stand the resolution to this issue is for that issue to be committed and closed as fixed and then for us to document it somewhere here β https://www.drupal.org/docs/contributed-themes/gin-admin-theme β β and i think in
gin.api.php
also. - πΊπΈUnited States mlncn Minneapolis, MN, USA
Hmm, actually we do need a bit more of an API than
#gin_action_item
or the code needs to be changed to allow an explicit['#gin_action_item'] = FALSE
to override Gin's hardcoded $include (used inincludes/form.theme
around line 90).Currently there is no way to move, say, the Save button into the Kebab when, say, the "Save and Edit Layout" should be primary.
- π©πͺGermany jurgenhaas Gottmadingen
@mlncn with the latest changes in π Improve sticky actions implementation Active my testing shows that:
'#gin_action_item' => TRUE
works reliably'#button_type' => 'primary'
makes any visible button appear like a primary button'#button_type' => 'normal'
makes any visible button appear as normal, even if it were primary without that setting
Please give that a try and let us know if you can confirm. If so, we can then put that status into the API documentation as you suggested.
- π¬π·Greece iro
I tested the cases described at #6 and they work as described. I tested all combinations.
- π¦πΉAustria hudri Austria
I've added a section about sticky buttons in the docs:
- π¨πSwitzerland saschaeggi Zurich
Thank you hudri, added you to the issue credit
Automatically closed - issue fixed for 2 weeks with no activity.