Commit 4e566836 authored by Nedjo Rogers's avatar Nedjo Rogers

Merge branch 'update-views' into 'master'

Update features docs for views chnages

See merge request !9
parents 7101c71f bd6974af
......@@ -14,6 +14,7 @@ These instructions will use the example of a yet to be built “resource” fea
* `field_summary` (required)
* `field_body_paragraph`
* `field_image`
* `field_topics`
* `field_tags`
* These fields should be added and configured as needed. Because we are using paragraphs for our main body, a required summary field is necessary for many display purposes and should always be included.
* When adding a new field, first determine if it will be specific to your feature or is perhaps a more generic field. If you think it is more generic, talk to a tech lead to consult. If it is specific, give it a name that includes the content type name, e.g. `field_resource_type`.
......@@ -44,6 +45,7 @@ These instructions will use the example of a yet to be built “resource” fea
* Where labels should be hidden, please use “Visually hidden” wherever possible.
* For the Image field, use Responsive image and set to wide or narrow as seems appropriate for your view mode.
* If you feel that you require a new view mode for your content type, please consult a tech lead.
* Enable and configure the search_index view mode with all labels hidden.
#### Formatting guidelines for card view mode
* Enable `card` in Custom display settings.
......@@ -79,7 +81,17 @@ Whenever creating a Display Suite field, configure to limit it to only the parti
* Label: Node resource
## Views
* Create a view using the singular name of the content, for example `resource`.
* As of the alpha5 release, content type views are based on a search index for that content type. Eventually we'll be adding facets to these listing pages.
### Create an index for your content type
* Ensure you have `drutopia_dev` and `entity_clone` installed and enabled.
* Clone the node_dev index to create a search index for each content type limiting it to that one content type. Give it the same name as the content type and update the description.
* Configure the search_index view mode for your content type and use it in the rendered HTML field on the search index.
* Add any fields that are specific to the content type, for example a type vocabulary. This will be needed for any field that we want to use for facets.
* Flush caches before proceeding.
### Create a view
* Create a new view based on the search index for your content type using the singular name of the content, for example `resource`.
* Most content types will need a page display and ideally a block display for promoted content. Other displays may be needed for a particular content type use case.
### Page display
......@@ -87,12 +99,13 @@ Whenever creating a Display Suite field, configure to limit it to only the parti
* A menu item should also be set here for easy export.
* Give it a normal menu entry, with the parent menu <main navigation>
* Give it a title, for example “Resources”, and a description, such as “Get connected with our resources.”
* Under format, show, use Display Suite Content and format to use the view mode you desire. You can choose to use the alternating view mode so that the top items show in a larger format. Again, follow the view of an existing content type as an example.
* Filter criteria
* Content: Publishing status (= Yes)
* Content: Content type (= Resource)
* Under format settings, ensure that Add views row classes is unchecked.
* Under format, show, use the rendered entity selecting an appropriate view mode (often card).
* Sort criteria
* Content: Authored on (desc)
* Sticky
* Content: Authored on (desc)
* Set the machine name to `page_listing`
* Set caching to none.
### Block display
* Create a block display for promoted content.
......@@ -113,6 +126,7 @@ Whenever creating a Display Suite field, configure to limit it to only the parti
* The machine name of the feature will be `resource`.
* Edit the description if needed.
* Ensure Drutopia is set as the bundle.
* To add the search_index view mode you will need to edit the feature, allow conflicts (as this view mode will be added to the seach feature by deafault) and manually add.
* Export your feature.
* After export, manually edit the info file to give it the name ‘Drutopia Resource’.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment