Skip to content

Commit 3671f1f

Browse files
author
Hugo Ribeiro
committed
[docs]Theme overriding examples table
1 parent 8145276 commit 3671f1f

File tree

5 files changed

+44
-15
lines changed

5 files changed

+44
-15
lines changed

docs/guides/templates/index.md

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -528,21 +528,14 @@ Templates can be overridden by a theme.
528528
1. Copy the `ratingui.mustache` file into the newly created `theme/timtam/templates/mod_wiki` and edit it.
529529
You should see your changes immediately if theme designer mode is on. Templates are cached just like CSS, so if you are not using theme designer mode you will need to purge all caches to see the latest version of an edited template. If the template you are overriding contains a documentation comment it is recommended to remove it. It will still show the documentation in the template library.
530530

531-
### Paths for overriding templates
532-
533-
#### Overriding a template from another plugin
534-
535-
If you want to override `theme/boost/templates/navbar.mustache`, you should copy and modify it, then **save the new version at** `theme/mytheme/templates/theme_boost/navbar.mustache`.
536-
537-
This principle applies to other plugins. For example, to override the template at `blocks/myoverview/templates/view-summary.mustache` you would place your own at `theme/mytheme/templates/block_myoverview/view-summary.mustache`.
538-
539-
#### Overriding a template from lib/
540-
541-
To override a core template, like, `lib/templates/notification_success.mustache:` you should have your own copy at `theme/mytheme/templates/core/notification_success.mustache`.
542-
543-
#### Overriding a core subsystem template
544-
545-
To override a core subsystem template, for example, `message/templates/message_preferences.mustache` place your template at `theme/mytheme/templates/core_message/message_preferences.mustache`.
531+
### Examples
532+
533+
| Path for original template | Component | Theme override path |
534+
| --- | --- | --- |
535+
| `public/blocks/myoverview/templates/view-summary.mustache` | `block_myoverview` | `public/theme/mytheme/templates/block_myoverview/view-summary.mustache` |
536+
| `public/group/templates/group_details.mustache` | `core_group` | `public/theme/mytheme/templates/core_group/group_details.mustache` |
537+
| `public/lib/templates/modal.mustache` | `core` | `public/theme/mytheme/templates/core/modal.mustache` |
538+
| `public/theme/boost/templates/navbar.mustache` | `theme_boost` | `public/theme/mytheme/templates/theme_boost/navbar.mustache` |
546539

547540
## Documenting the templates
548541

versioned_docs/version-4.1/guides/templates/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,15 @@ Templates can be overridden by a theme.
528528
1. Copy the `ratingui.mustache` file into the newly created `theme/timtam/templates/mod_wiki` and edit it.
529529
You should see your changes immediately if theme designer mode is on. Templates are cached just like CSS, so if you are not using theme designer mode you will need to purge all caches to see the latest version of an edited template. If the template you are overriding contains a documentation comment it is recommended to remove it. It will still show the documentation in the template library.
530530

531+
### Examples
532+
533+
| Path for original template | Component | Theme override path |
534+
| --- | --- | --- |
535+
| `blocks/myoverview/templates/view-summary.mustache` | `block_myoverview` | `theme/mytheme/templates/block_myoverview/view-summary.mustache` |
536+
| `group/templates/group_details.mustache` | `core_group` | `theme/mytheme/templates/core_group/group_details.mustache` |
537+
| `lib/templates/modal.mustache` | `core` | `theme/mytheme/templates/core/modal.mustache` |
538+
| `theme/boost/templates/navbar.mustache` | `theme_boost` | `theme/mytheme/templates/theme_boost/navbar.mustache` |
539+
531540
## Documenting the templates
532541

533542
Theme designers need to know the limits of what they can expect to change without breaking anything. Also, correctly documented templates can be previewed in the "Template library" tool shipped with Moodle.

versioned_docs/version-4.4/guides/templates/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,15 @@ Templates can be overridden by a theme.
528528
1. Copy the `ratingui.mustache` file into the newly created `theme/timtam/templates/mod_wiki` and edit it.
529529
You should see your changes immediately if theme designer mode is on. Templates are cached just like CSS, so if you are not using theme designer mode you will need to purge all caches to see the latest version of an edited template. If the template you are overriding contains a documentation comment it is recommended to remove it. It will still show the documentation in the template library.
530530

531+
### Examples
532+
533+
| Path for original template | Component | Theme override path |
534+
| --- | --- | --- |
535+
| `blocks/myoverview/templates/view-summary.mustache` | `block_myoverview` | `theme/mytheme/templates/block_myoverview/view-summary.mustache` |
536+
| `group/templates/group_details.mustache` | `core_group` | `theme/mytheme/templates/core_group/group_details.mustache` |
537+
| `lib/templates/modal.mustache` | `core` | `theme/mytheme/templates/core/modal.mustache` |
538+
| `theme/boost/templates/navbar.mustache` | `theme_boost` | `theme/mytheme/templates/theme_boost/navbar.mustache` |
539+
531540
## Documenting the templates
532541

533542
Theme designers need to know the limits of what they can expect to change without breaking anything. Also, correctly documented templates can be previewed in the "Template library" tool shipped with Moodle.

versioned_docs/version-4.5/guides/templates/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,15 @@ Templates can be overridden by a theme.
528528
1. Copy the `ratingui.mustache` file into the newly created `theme/timtam/templates/mod_wiki` and edit it.
529529
You should see your changes immediately if theme designer mode is on. Templates are cached just like CSS, so if you are not using theme designer mode you will need to purge all caches to see the latest version of an edited template. If the template you are overriding contains a documentation comment it is recommended to remove it. It will still show the documentation in the template library.
530530

531+
### Examples
532+
533+
| Path for original template | Component | Theme override path |
534+
| --- | --- | --- |
535+
| `blocks/myoverview/templates/view-summary.mustache` | `block_myoverview` | `theme/mytheme/templates/block_myoverview/view-summary.mustache` |
536+
| `group/templates/group_details.mustache` | `core_group` | `theme/mytheme/templates/core_group/group_details.mustache` |
537+
| `lib/templates/modal.mustache` | `core` | `theme/mytheme/templates/core/modal.mustache` |
538+
| `theme/boost/templates/navbar.mustache` | `theme_boost` | `theme/mytheme/templates/theme_boost/navbar.mustache` |
539+
531540
## Documenting the templates
532541

533542
Theme designers need to know the limits of what they can expect to change without breaking anything. Also, correctly documented templates can be previewed in the "Template library" tool shipped with Moodle.

versioned_docs/version-5.0/guides/templates/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,15 @@ Templates can be overridden by a theme.
528528
1. Copy the `ratingui.mustache` file into the newly created `theme/timtam/templates/mod_wiki` and edit it.
529529
You should see your changes immediately if theme designer mode is on. Templates are cached just like CSS, so if you are not using theme designer mode you will need to purge all caches to see the latest version of an edited template. If the template you are overriding contains a documentation comment it is recommended to remove it. It will still show the documentation in the template library.
530530

531+
### Examples
532+
533+
| Path for original template | Component | Theme override path |
534+
| --- | --- | --- |
535+
| `blocks/myoverview/templates/view-summary.mustache` | `block_myoverview` | `theme/mytheme/templates/block_myoverview/view-summary.mustache` |
536+
| `group/templates/group_details.mustache` | `core_group` | `theme/mytheme/templates/core_group/group_details.mustache` |
537+
| `lib/templates/modal.mustache` | `core` | `theme/mytheme/templates/core/modal.mustache` |
538+
| `theme/boost/templates/navbar.mustache` | `theme_boost` | `theme/mytheme/templates/theme_boost/navbar.mustache` |
539+
531540
## Documenting the templates
532541

533542
Theme designers need to know the limits of what they can expect to change without breaking anything. Also, correctly documented templates can be previewed in the "Template library" tool shipped with Moodle.

0 commit comments

Comments
 (0)