|
| 1 | +# Collection View |
| 2 | + |
| 3 | +`Alias: Umbraco.ListView` |
| 4 | + |
| 5 | +`Returns: IEnumerable<IPublishedContent>` |
| 6 | + |
| 7 | +**Collection View** display a collection of categories when it is enabled on a Document Type that has children. |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +## Enable collection view |
| 12 | + |
| 13 | +If enabled, editors will be able to see multiple children from a collection on a content node that has children. When not enabled, no collection will be shown and all children will be shown in the Content Tree. |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | +## Settings |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | +### Page Size |
| 23 | + |
| 24 | +Defines how many child content nodes you want to see per page. This will limit how many content items you will see in your collection. If you set it to 5, then only 5 content items will be shown in the collection. |
| 25 | + |
| 26 | +### Order By |
| 27 | + |
| 28 | +Will sort your collection by the selection you choose in the dropdown. By default it selects "Last edited" and you get the following three columns: |
| 29 | + |
| 30 | +* **Last edited** - When the content node was last edited and saved. |
| 31 | +* **Name** - Name of the content node(s). |
| 32 | +* **Created by** - This is the user who the content node was created by. |
| 33 | + |
| 34 | +You can add more sorting to this collection by adding more datatypes to the columns in the "Columns Displayed" section. |
| 35 | + |
| 36 | +### Order Direction |
| 37 | + |
| 38 | +You can select order of the content nodes displayed, "Acsending" or "Descending". The order is affected by the "Order By" selection. |
| 39 | + |
| 40 | +### Columns Displayed |
| 41 | + |
| 42 | +It is possible to add more columns to the collection, via adding the properties through the dropdown. These properties are based on the Data Types which are used by the Document Type. It will show up in the dropdown by its alias and not the name on the property. |
| 43 | + |
| 44 | +  |
| 45 | + |
| 46 | +Once you have selected a column that you want to display, the next thing you want to do is define what its name should be and what kind of value it should display. You can also move the headers around, re-ordering how the headers should look. This is done by the move icon on the left side of the alias. |
| 47 | + |
| 48 | +The template section is where you define what kind of value you want to display. The value of the column is in the `value` variable. |
| 49 | + |
| 50 | +### Layouts |
| 51 | + |
| 52 | +The collection view comes with two layouts by default. A list and a grid view. These views can be disabled if you are not interested in any of them. |
| 53 | + |
| 54 | +{% hint style="info" %} |
| 55 | +A minimum of one layout needs to be enabled for the collection view to work. |
| 56 | +{% endhint %} |
| 57 | + |
| 58 | +You can also make your own layout and add it to the settings. For example, if you wanted to change the width or length of the grid, you will be able to do so. |
| 59 | + |
| 60 | +### Bulk Action Permissions |
| 61 | + |
| 62 | +Select what kind of action is available on the collection view. |
| 63 | + |
| 64 | +* **Allow bulk publish** - content only |
| 65 | +* **Allow bulk unpublish** - content only |
| 66 | +* **Allow bulk copy** - content only |
| 67 | +* **Allow bulk move** |
| 68 | +* **Allow bulk delete** |
| 69 | + |
| 70 | +### Workspace View icon |
| 71 | + |
| 72 | +Changes the icon in the backoffice of the collection. By default it will look like the image below. |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | +### Workspace View name |
| 77 | + |
| 78 | +You can change the name of the collection view itself. Default if empty: 'Child Items'. |
| 79 | + |
| 80 | +### Show Content Workspace View First |
| 81 | + |
| 82 | +Enable this to show the Content Workspace View by default instead of the Collection's. |
| 83 | + |
| 84 | +## Content Example |
| 85 | + |
| 86 | +### Generic field value |
| 87 | + |
| 88 | +This example uses a generic field on a child item and displays it in the collection.  |
| 89 | + |
| 90 | +The `{{ value }}` will take the value of the Email property and display it in the collection, as shown on the image below. |
| 91 | + |
| 92 | + |
| 93 | + |
| 94 | +### Member name |
| 95 | + |
| 96 | +First, a Member Picker property needs to be present on the content item. In this example, the `child item` has gotten a Member Picker Data Type with the alias of `isAuthor`. |
| 97 | + |
| 98 | + |
| 99 | + |
| 100 | +Now that the child item has a member and the value that should be displayed is the name of the picked value, the next step is to reconfigure the template value in the collection view setting. |
| 101 | + |
| 102 | + |
| 103 | + |
| 104 | +This will take the value picked up by the member picker.  |
| 105 | + |
| 106 | +And display it in the collection view. Shown in the example below:  |
| 107 | + |
| 108 | +### Other examples |
| 109 | + |
| 110 | +  |
0 commit comments