Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop using "Default" view mode and start using "Full content" view mode instead #58

Open
markconroy opened this issue Apr 9, 2021 · 1 comment

Comments

@markconroy
Copy link
Member

markconroy commented Apr 9, 2021

We should stop using the "Default" view mode. The point of that view mode is that it is used as a fallback when none others are available.

For example, if you have a view that lists items using a "Search Result" view mode, but you have no "Search Result" view mode configured for one of your content types. Then that content type will use "Default".

In that case, "Default" should use a minimal amount of fields - image, teaser text, perhaps one or two more - that would be available on all view modes in any case.

Then we use "Full content" view mode for items in full details view.

This gives us the benefit of having the fields we need for each (new) view mode already available on them out of the box when we create new view modes, and means that we don't render what we now have for full view mode in any listings that don't have the view mode of that listing set (we don't want to accidentally render a full news article in a search result).

It also means we will use node--{content-type}--full.html.twig for the full view mode template for our content types and not need to create template suggestions for them.

@markconroy
Copy link
Member Author

Another issue that this throws up is that every field that gets added to a content type is automatically added to "Default", which might expose fields to users that we didn't mean to expose.

If we enable "Full content", then we have to explicitly say what fields we want. This is a much more secure way to build a Drupal website - don't leave things to chance.

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

No branches or pull requests

1 participant