Reviewed: https://reviews.mahara.org/9326 Committed: https://git.mahara.org/mahara/mahara/commit/b4e9bc3d803f8ddd7e440631817f912174c9dcbc Submitter: Cecilia Vela Gurovic ([email protected]) Branch: master
commit b4e9bc3d803f8ddd7e440631817f912174c9dcbc Author: Robert Lyon <[email protected]> Date: Fri Nov 23 09:52:34 2018 +1300 Bug 1791544: Adding MENUITEM to view/view.php page So that sideblocks don't throw error behatnotneeded Change-Id: I2892e7bd65e3a031154b74c2cba47ef570e80b5d Signed-off-by: Robert Lyon <[email protected]> -- You received this bug notification because you are a member of Mahara Contributors, which is subscribed to Mahara. Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it! https://bugs.launchpad.net/bugs/1791544 Title: Make an easier way to decide which sideblocks are shown on which pages Status in Mahara: Fix Committed Bug description: Currently we have only a couple of ways to show side blocks on a page. 1) If we want a sideblock to appear on only one page we can add the code to the $smarty call from the page as the 4th array or parameters, for example: $smarty = new smarty(array(), array(), array(), array('sideblocks' => array(array('name' => 'customblock', 'weight' => 20, 'data' => 'test data')))); But we also need to create the corresponding 'customblock' theme template in the sideblocks to display the block. 2) If we want the sideblock to appear on multiple pages we tend to add the block to the smarty() function directly below the "sideblock stuff" do a bunch of checks to see which blocks can be added to what pages - this section is quite confusing / all hardcoded / difficult to change. Some sideblocks are shown based on the menu section they are in, which makes sense for some of the menu options but not others. ---------- I feel this needs to be tidied up and simplified so that we end up with a system that can do an easier version of option (1) - where we can just create the array for $smarty and it will use a generic sideblock template if you one doesn't need to define a custom one. So the array for some static content could look like: array('name' => 'customblock', 'weight' => 20, 'title' => 'Custom block', 'content' => 'My custom content', 'template' => false, ) where we pass in a content string versus one that requires dynamic content array('name' => 'customblock', 'weight' => 20, 'title' => 'Custom block', 'content' => custom_block_data(), 'template' => 'sideblocks/customblock.tpl', ) where we pass in a content array/object to our custom template And for option (2) we need a easier way for defining the array of sideblocks. We also need an easy way for the page being displayed to be able to convey information to the sideblocks array (like what we do for the menu array). We also need a way for modules/plugins to be able to add to the sideblock array if the plugin needs to have the block on multiple pages To manage notifications about this bug go to: https://bugs.launchpad.net/mahara/+bug/1791544/+subscriptions _______________________________________________ Mailing list: https://launchpad.net/~mahara-contributors Post to : [email protected] Unsubscribe : https://launchpad.net/~mahara-contributors More help : https://help.launchpad.net/ListHelp

