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

Комментарии • 14

  • @santoshk39
    @santoshk39 4 года назад +4

    Nice. Can you please make a video on front page customization. How to override footer and header?

    • @benjaminschroder1627
      @benjaminschroder1627 4 года назад

      Maybe also add a custom build bootstrap slider into the template?

  • @Paul-jx6vz
    @Paul-jx6vz 3 года назад

    Very clear and helpful. Thank you.

  • @SanjayKumar001
    @SanjayKumar001 4 года назад +3

    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.

    • @moodletips
      @moodletips  4 года назад +1

      It is phpstorm 👍 sublime is good too

  • @Magistrado1914
    @Magistrado1914 4 года назад +1

    Excellent course
    27/07/2020

  • @varunkumarmachipeddi1978
    @varunkumarmachipeddi1978 3 года назад

    can you please tell me how to display boxes in moodle in which want to retrieve some data from database and put it there

    • @moodletips
      @moodletips  3 года назад

      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 👍

  • @godwinfrance2156
    @godwinfrance2156 3 года назад +1

    please where is 4/4 ?

  • @mostafaibrahim2066
    @mostafaibrahim2066 4 года назад

    Can I edit menu of moodle ?????

    • @moodletips
      @moodletips  4 года назад +1

      mostafa ibrahim
      You can add Custom menu items in theme settings at Site administration > Appearance > Themes > Theme settings

    • @mostafaibrahim2066
      @mostafaibrahim2066 4 года назад

      @@moodletips But this customize the menu there is in navigation l want to add link for menu there is in left sidebar