Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-39824 Simplification of themes
  3. MDL-39841

Replace blocks_for_region call with new method block_container

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: FRONTEND
    • Component/s: Themes
    • Labels:
    • Affected Branches:
      MOODLE_25_STABLE

      Description

      The current method is to have a specific structure in the layout file, and then call blocks_for_region inside that structure. A better way is to have a new call that writes the block container and the blocks within it. This means we can move the logic of when to show the block container into the renderer and out of the layout files:

      Sample layout code:

       
      <?php echo $OUTPUT->blocks_container('side-pre', 'aside', array('extraclass1', 'extraclass2')); ?>
      

      This would write the complete container using the specified tag type (e.g. div/aside and any additional classes).

      This also implies we move all RTL logic completely to the CSS.

      E.g. side-pre would always be rendered and the CSS would move it to the right or left depending on RTL.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            lazydaisy Mary Evans added a comment -

            Fixed in MDL-39824

            Show
            lazydaisy Mary Evans added a comment - Fixed in MDL-39824

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: