-
-
Save jacine/3b364d5456e5275b3e825d47c54005fd to your computer and use it in GitHub Desktop.
Manage Display Notes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# | |
2-way communication between UI config screens and templates. | |
----------------------------------------------------------------------------- | |
The Manage Display screen should be aware of anything this template affects. | |
This information is less useful if the base template is in use, i.e. node.twig | |
as opposed to node--article.twig, but consistency in communication is more | |
important, so doing it globally is best. The template should be gleaned using | |
the same logic as theme hook suggestions. | |
It's presence alone doesn't necessarily mean the theme wants full control over | |
its display. However, in these cases where both UI and template settings are | |
competing, displaying a message with a heads up that is happening with X | |
template, is at least something, as this is a huge problem that is nearly | |
impossible to document meaningfully for the many stakeholders typically have | |
access to these screens, such as site builders, administrators, back and front | |
end developers. | |
#} | |
{# | |
Disable configuration | |
------------------------------------------------------------------------------ | |
Explicitly state this template is taking over the configuration. This might be | |
something that can only be done with a specific override, as opposed to a base | |
hook template. Not sure. What I'd expect it to do this, is the following: | |
1. Provide a message stating that the template has overridden the ability to | |
use this screen. | |
2. Disable drag and drop UI. | |
3. Provide simpler UI that allows 3 things to happen for each field (in | |
order of importance). | |
a. Set field formatter and settings. | |
b. Toggle field visibility | |
c. Set label settings (which should be hidden by default like in Views | |
module and located in a single settings form with formatter settings. | |
#} | |
{% set ui.configuration.ordering = FALSE %} | |
{% set ui.configuration.formatters = TRUE %} | |
{# | |
Disable fields | |
------------------------------------------------------------------------------ | |
Need to disable fields that we don't want, like "hidden" on "Manage Display" | |
screens. I realize we have {{ content|without('field_whatever') }}, but this | |
isn't the same thing. This should stop the field data from loading, as well | |
as prevent any configuration, such as assigning a formatter and settings. | |
#} | |
{% set ui.configuration.fields = [ | |
'field_category', | |
'field_tags', | |
'field_node_links', | |
'field_node_author', | |
'field_user', | |
] | |
%} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment