mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #51180
[Bug 1791544] A patch has been submitted for review
Patch for "master" branch: https://reviews.mahara.org/9386
--
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
References