Moodle theme tutorial 3/4 - How to override a template in Moodle
HTML-код
- Опубликовано: 3 окт 2024
- Get the full course on Udemy: www.udemy.com/...
Here we override a template in our custom theme. We change the output behaviour of the core moodle course overview block.
docs.moodle.or...
Templates vs renderers
Important to remember that this is different to overriding a renderer. For templates, in PHP we write code that calculates, queries the database, and provides data to a template (called template context). A template takes that data and outputs it within normal html. This means it's easy to override and change the display without changing or looking at php code.
A renderer does the same job as templates but the PHP code itself outputs the html as a big string. The disadvantage is that to change any part of the render even just a html tag it's usually necessary to override the whole rendering function including the PHP logic.
If you would like a video about overriding a renderer, let me know in a comment below.
You can find the code here: github.com/kri...
To set up a local moodle environment, see: • Moodle setup tutorial ...
To create a block plugin, see: • Moodle developer tutor...
For custom development work, one on one training, or Moodle hosting, get in touch with us over at ringertech.org...
Nice. Can you please make a video on front page customization. How to override footer and header?
Maybe also add a custom build bootstrap slider into the template?
Very clear and helpful. Thank you.
Excellent and very well explained.
Thank you for sharing your knowledge.
Just curious to know which IDE are you using ? Is it sublime ?
I guess it is phpstorm as you mentioned in earlier tutorial.
It is phpstorm 👍 sublime is good too
Excellent course
27/07/2020
can you please tell me how to display boxes in moodle in which want to retrieve some data from database and put it there
You probably want to make a new block. They can be put in a course or on the dashboard. Check out my block tutorial for how to do this 👍
please where is 4/4 ?
ruclips.net/video/NvxtfdaxD4A/видео.html
@@moodletips thanks
Can I edit menu of moodle ?????
mostafa ibrahim
You can add Custom menu items in theme settings at Site administration > Appearance > Themes > Theme settings
@@moodletips But this customize the menu there is in navigation l want to add link for menu there is in left sidebar