Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-30132

Profile page layout defaults to 'mydashboard' when it should be using 'mypublic'

    XMLWordPrintable

Details

    • MOODLE_21_STABLE
    • MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • MDL-30132_master
    • Hide

      Change user->profile.php line 91 from

      $PAGE->set_pagelayout('dashbaord');

      to

      $PAGE->set_pagelayout('mypublic');

      Show
      Change user->profile.php line 91 from $PAGE->set_pagelayout('dashbaord'); to $PAGE->set_pagelayout('mypublic');
    • Hide
      1. Login as Admin and enable 'Show page information' in Development > Debugging
      2. Go to the Home page and select My Profile > View profile from Navigation block
      3. Scroll to the bottom of the page and TEST to see that the information written there reads:
        This page is: General type: mypublic.
      4. Go back to the Home page and select My home from the Navigation block.
      5. Scroll to the bottom of the page and TEST to see that the information written there reads:
        This page is: General type: mydashboard.
      6. END TEST
      Show
      Login as Admin and enable 'Show page information' in Development > Debugging Go to the Home page and select My Profile > View profile from Navigation block Scroll to the bottom of the page and TEST to see that the information written there reads: This page is: General type: mypublic. Go back to the Home page and select My home from the Navigation block. Scroll to the bottom of the page and TEST to see that the information written there reads: This page is: General type: mydashboard. END TEST

    Description

      The profile page defaults to the mydashboard.php layout file when perhaps it should be using mypublic.php layout. This means any extra content added to the "my" page also appears on the profile page. See discussion http://moodle.org/mod/forum/discuss.php?d=172453#p825495

      Set theme config.php file as below

      $THEME->layouts = array(
      ...
          'mydashboard' => array(
              'file' => 'dashboard.php',
              'regions' => array('side-pre', 'side-post'),
              'defaultregion' => 'side-post',
          ),
          'mypublic' => array(
              'file' => 'mypublic.php',
              'regions' => array('side-pre'),
              'defaultregion' => 'side-pre',
          ),
      ...
      }
      

      Create theme layout files mydashboard.php and mypublic.php. Add extra content to the mydashboard.php layout file ie...

      <div id="region-main-wrap">
          <div id="region-main">
              <div class="region-content">
              <?php 
                  echo $OUTPUT->dashboard_extra_content();
                  echo $OUTPUT->main_content;
              ?>
              </div>
          </div>
      </div>
      

      The extra content added to the mydashboard.php file appears on the profile page regardless of the associated layout file in the theme config.php array

      Attachments

        Issue Links

          Activity

            People

              lazydaisy Mary Evans
              daranprice daran price
              Sam Hemelryk Sam Hemelryk
              Andrew Davis Andrew Davis
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona), Huong Nguyen, Bas Brands, Mathew May
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                8/Jul/13