-
Improvement
-
Resolution: Fixed
-
Minor
-
3.5
-
MOODLE_35_STABLE
-
MOODLE_35_STABLE
-
MDL-60880-master -
Currently it is possible to restrict a search to specified course or courses but not to a single context, such as an activity. For example, you cannot search only within a specific forum. This is a common requirement for our users.
I propose making it possible to also search within a single specified bottom-level context - one activity. The system would still check you can access that context as before.
Note this feature is not intended to support a tree of subcontexts (i.e. you can't search a whole category or something this way) - only to search a specified context or contexts.
There are two parts to this change: the back-end and the front-end UI. The back-end is relatively straightforward. (If there is any degree of controversy about this I might split into two issues so we can get the back-end committed and argue about the rest later!)
For the front-end, I propose a simple minimal implementation for context-sensitive search (I think this was Tim's idea originally):
- When you carry out a search from the header, the context id for the page you searched on will be passed to the search form.
- If you search within a course, activity, or block context, then the search page will display a new Search within dropdown.
- From the dropdown you can choose to search everything you can access (the default behaviour, as at present), or only within the current course that you came from, or only within the current block/activity that you came from.
- If the Search within dropdown appears, then the existing Courses option that lets you select a course does not appear.
When you search from the site level or another context, you don't get the Search within option, and you do get the ability to choose one or more courses again.
See screenshot.