Skip to content

[docs] Templates paths to override in a theme #1411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/guides/templates/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,15 @@ Templates can be overridden by a theme.
1. Copy the `ratingui.mustache` file into the newly created `theme/timtam/templates/mod_wiki` and edit it.
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.

### Examples

| Path for original template | Component | Theme override path |
| --- | --- | --- |
| `public/blocks/myoverview/templates/view-summary.mustache` | `block_myoverview` | `public/theme/mytheme/templates/block_myoverview/view-summary.mustache` |
| `public/group/templates/group_details.mustache` | `core_group` | `public/theme/mytheme/templates/core_group/group_details.mustache` |
| `public/lib/templates/modal.mustache` | `core` | `public/theme/mytheme/templates/core/modal.mustache` |
| `public/theme/boost/templates/navbar.mustache` | `theme_boost` | `public/theme/mytheme/templates/theme_boost/navbar.mustache` |

## Documenting the templates

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.
Expand Down
9 changes: 9 additions & 0 deletions versioned_docs/version-4.1/guides/templates/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,15 @@ Templates can be overridden by a theme.
1. Copy the `ratingui.mustache` file into the newly created `theme/timtam/templates/mod_wiki` and edit it.
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.

### Examples

| Path for original template | Component | Theme override path |
| --- | --- | --- |
| `blocks/myoverview/templates/view-summary.mustache` | `block_myoverview` | `theme/mytheme/templates/block_myoverview/view-summary.mustache` |
| `group/templates/group_details.mustache` | `core_group` | `theme/mytheme/templates/core_group/group_details.mustache` |
| `lib/templates/modal.mustache` | `core` | `theme/mytheme/templates/core/modal.mustache` |
| `theme/boost/templates/navbar.mustache` | `theme_boost` | `theme/mytheme/templates/theme_boost/navbar.mustache` |

## Documenting the templates

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.
Expand Down
9 changes: 9 additions & 0 deletions versioned_docs/version-4.4/guides/templates/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,15 @@ Templates can be overridden by a theme.
1. Copy the `ratingui.mustache` file into the newly created `theme/timtam/templates/mod_wiki` and edit it.
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.

### Examples

| Path for original template | Component | Theme override path |
| --- | --- | --- |
| `blocks/myoverview/templates/view-summary.mustache` | `block_myoverview` | `theme/mytheme/templates/block_myoverview/view-summary.mustache` |
| `group/templates/group_details.mustache` | `core_group` | `theme/mytheme/templates/core_group/group_details.mustache` |
| `lib/templates/modal.mustache` | `core` | `theme/mytheme/templates/core/modal.mustache` |
| `theme/boost/templates/navbar.mustache` | `theme_boost` | `theme/mytheme/templates/theme_boost/navbar.mustache` |

## Documenting the templates

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.
Expand Down
9 changes: 9 additions & 0 deletions versioned_docs/version-4.5/guides/templates/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,15 @@ Templates can be overridden by a theme.
1. Copy the `ratingui.mustache` file into the newly created `theme/timtam/templates/mod_wiki` and edit it.
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.

### Examples

| Path for original template | Component | Theme override path |
| --- | --- | --- |
| `blocks/myoverview/templates/view-summary.mustache` | `block_myoverview` | `theme/mytheme/templates/block_myoverview/view-summary.mustache` |
| `group/templates/group_details.mustache` | `core_group` | `theme/mytheme/templates/core_group/group_details.mustache` |
| `lib/templates/modal.mustache` | `core` | `theme/mytheme/templates/core/modal.mustache` |
| `theme/boost/templates/navbar.mustache` | `theme_boost` | `theme/mytheme/templates/theme_boost/navbar.mustache` |

## Documenting the templates

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.
Expand Down
9 changes: 9 additions & 0 deletions versioned_docs/version-5.0/guides/templates/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,15 @@ Templates can be overridden by a theme.
1. Copy the `ratingui.mustache` file into the newly created `theme/timtam/templates/mod_wiki` and edit it.
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.

### Examples

| Path for original template | Component | Theme override path |
| --- | --- | --- |
| `blocks/myoverview/templates/view-summary.mustache` | `block_myoverview` | `theme/mytheme/templates/block_myoverview/view-summary.mustache` |
| `group/templates/group_details.mustache` | `core_group` | `theme/mytheme/templates/core_group/group_details.mustache` |
| `lib/templates/modal.mustache` | `core` | `theme/mytheme/templates/core/modal.mustache` |
| `theme/boost/templates/navbar.mustache` | `theme_boost` | `theme/mytheme/templates/theme_boost/navbar.mustache` |

## Documenting the templates

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.
Expand Down