Dataform Manage Views
Note: You are currently viewing documentation for Moodle 3.7. Up-to-date documentation for the latest stable version of Moodle may be available here: Dataform Manage Views.
- Activity administration
- Building an activity
- CSS tips and tricks
- JS tips and tricks
- Activating RSS
- Activity workflow
Dataform views allow you to control the way entries and other information is displayed in the activity. Views management is done under the Manage | Views tab. It requires and requires either the mod/dataform:managetemplates capability or the mod/dataform:manageviews capability.
Adding a view
To add a view select the view type from the 'Add a view' dropdown. This will open the view configuration form where you can configure the view templates and behaviour. Typically, views have default configuration and if this default configuration serves your purpose you can simply enter a name for the view and save.
Setting the default view
The Dataform activity must have a default view to fall back on to when the activity is accessed without specifying the target view (for instance, when you access the activity from the activity link on the course page).
A Dataform activity without a default view is not ready and a message will be displayed on its front page and in the view list advising you to set a default view.
You can select the default view by clicking the 'Default' box in the view list. The selected default view is marked by a check sign. You can change the default view at any time. Since the default view must be visible, if you set a hidden view to default, this view will automatically become visible and you will not be able to hide it as long as it is the default view.
Setting view visibility
A view can be either visible or hidden. Visible views can be accessed by users with capability mod/dataform:viewaccess that is granted by default to all roles. Hidden views can be accessed by users with capability mod/dataform:viewaccesshidden that is granted by default only to the teacher role. Users without the required capability will not see views with the respective visibility setting in the standard views navigation menu (##viewsmenu##). Setting the view visibility can be done from the views index by clicking the eye icon of the designated view or from the visibility setting in the view configuration form. The default view must be visible and setting a hidden view as the default view will automatically change its visibility to visible.
Forcing a view filter
When filters are defined for the activity you can force a filter on a view by selecting the filter either from the index list or in the view configuration form. When the view forces a filter, users without capability mod/dataform:viewfilteroverride cannot apply other activity filters (the activity filters menu will not be displayed) and user advanced filters (if the option is added to the view) will be appended to the forced filter.
Resetting a view
Each view type has default templates which are generated and automatically added to the configuration form when adding a new view. The default View template typically consists of navigation menus, quick filters, add new entry link and entries display. The default Entry template (where applicable) typically adds the base pattern for each field and the edit and delete action buttons. As you build the activity you may change the templates of a view and in some cases you may wish to reset the templates to their defaults. This can be done by clicking the reset icon of the designated view in the views index or in the view configuration form.
Updating a view
You can click on the edit icon of the view to open the configuration form for updating.
Note: Clicking on the view name will open the view in browse mode rather than the configuration form.
Duplicating one or more views
You can duplicate a view by clicking the duplicate icon of the view. This will create an exact copy of the duplicated view with a different name. You can then proceed to update the view settings. This may be particularly useful if you need to create several very similar views. For example, you can create a complex view and then duplicate it, and assign to each of the instances a different filter so as to have a designated view for certain subsets of the entries.
You can duplicate more than one view in one go by selecting the designated views and clicking the bulk-duplicate icon (in the list's header).
Deleting one or more views
You can delete a view by clicking the delete icon of the view.
You can delete more than one view in one go by selecting the designated views and clicking and bulk-delete icon (in the list's header).