Skip to content

Commit 44f323d

Browse files
Menrathbartdenhoedabias
authored
add: snippet which adds course search box to top on startpage (#3)
* First release of the snippets repository, based on the outcome of MoodleMootDACH and amended by the Boost Union maintainers afterwards * add: snippet course search box to above content on startpage * rebase * Update boilerplate.scss * fix: must use scss file * change: scope to dashboard * Review changes * add: ci-lint workflow (#4) * Allow lines to be longer than 132 chars --------- Co-authored-by: Bart den Hoed <git@bartdenhoed.nl> Co-authored-by: Alexander Bias <abias@ssystems.de>
1 parent c5d8233 commit 44f323d

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Each particular snippet should have a `Scope` tag and thereby be assigned to a s
4141
- `global`: These snippets affect the entire site
4242
- `course`: These snippets affect only the course context
4343
- `dashboard`: These snippets affect only the dashboard of a user
44+
- `sitehome`: These snippets affect only the site home page of site
4445

4546
The list of scopes is not necessarily limited to these existing scopes, additional scopes can be added in the future.
4647

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* Snippet Title: Move course search box to top on site home
3+
* Scope: sitehome
4+
* Goal: easeofuse
5+
* Description: The course search box on site home is very important to many users. But when existing content on site home is very long, it is positioned quite unprominent. This snippet always puts the course search box on top on site home.
6+
* Creator: André Menrath
7+
* Tested on: Moodle 5.0, Firefox for Mac
8+
* Usage note: For this snippet to have any effect, the course search box has to be enabled in the frontpageloggedin site admin setting.
9+
*
10+
* @copyright 2025 University of Graz
11+
* @author André Menrath <andre.menrath@uni-graz.at>
12+
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
13+
*/
14+
15+
/* Make all site home content a flex container. This allows us to order the elements inside the container. */
16+
#page-site-index #region-main > div {
17+
display: flex;
18+
flex-direction: column;
19+
width: 100%;
20+
flex-wrap: nowrap;
21+
}
22+
23+
/* The course search box */
24+
#page-site-index #region-main > div > div.box:has(.simplesearchform) {
25+
order: 1;
26+
}
27+
28+
/* The course content*/
29+
#page-site-index #region-main > div > div.course-content {
30+
order: 2;
31+
}
32+
33+
/* All other stuff */
34+
#page-site-index #region-main > div > * {
35+
order: 3;
36+
}
Binary file not shown.

0 commit comments

Comments
 (0)