Giter Site home page Giter Site logo

catalyst / moodle-block_multiblock Goto Github PK

View Code? Open in Web Editor NEW
12.0 23.0 12.0 1.1 MB

Moodle plugin which allows you to embed multiple blocks within a single block region using different formats including tabs and accordions

License: GNU General Public License v3.0

PHP 66.70% CSS 1.97% Gherkin 8.43% Mustache 22.90%
moodle moodle-block moodle-plugin

moodle-block_multiblock's Introduction

Multiblock

Build Status License: GPL v3 GitHub last commit

Moodle 3.5 supported Moodle 3.6 supported for data loss items Moodle 3.7 supported Moodle 3.8 supported Moodle 3.9 supported Moodle master supported Totara 12 support

What is this?

This is a sort of magic metablock. Suppose you're using Boost and you have a whole bunch of blocks making a course page longer than it should be, or cluttering up your Dashboard.

Using Multiblock you can collect all those blocks together and use 'one block's worth' of space and put all those blocks into the one space with one of several layouts, whether it's tabs or an accordion, or something else. Several preset layouts are bundled with Multiblock.

What styles of presentation are there?

Show and tell time, I guess. Screenshots from 3.6 with Boost with the accent colour changed.

Tabbed layout:

Tabbed layout

Vertical tabbed layout (left)

Vertical tabbed layout

Vertical tabbed layout (right)

Vertical tabbed layout

Accordion layout:

Accordion layout

Dropdown layout:

Dropdown layout

Tabs with columns inside it:

Tabs with columns

There's also some 2-column layouts where the 'multiblock' container has no title so it integrates better into the look and feel. The styling is designed for Boost so mileage with other themes will absolutely vary.

2 column (equal width):

2 column layout (equal width)

2 column (66% / 33%):

2 column layout (66% / 33%)

2 column (33% / 66%):

2 column layout (33% / 66%)

And now a 3-column equal width layout:

3 column layout (equal width)

Support

If you find a bug, please use GitHub to file an issue - they should be added to https://github.com/arantor/moodle-block_multiblock/issues

Please note that I make no guarantees around resolution times and if you need something more concrete in terms of resolutions, or development, please contact Catalyst IT Europe to discuss your needs.

https://www.catalyst-eu.net/content/contact-us

moodle-block_multiblock's People

Contributors

alexmorrisnz avatar andrewmadden avatar arantor avatar danmarsden avatar ewallah avatar guillogo avatar james-pearce-bath-ac avatar limekiller avatar ma2716 avatar marxjohnson avatar michaelkotlyar avatar peterburnett avatar sumaiyamannan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

moodle-block_multiblock's Issues

Carousel

Add the ability to have a Bootstrap carousel as a display choice.

Additionally if a 3-pane carousel is an option, that could be added too.

Totara compatibility

Would be nice if it could work on Totara 12+

  • Version requirement needs to be dropped to match Moodle 3.3.9 minimum version
  • Adding a subblock needs to not rely on the parent block for default region for some reason, but should query the block manager for default region (may affect Moodle if themes declare different regions for different layouts)
  • Breadcrumb trail is wrong in Totara for some reason; adding a multiblock seems to target a completely different course
  • The base block_edit_form class declares definition as final so that might make the proxy form different now (perhaps a definition_after_data to strip everything out, hopefully it won't need nasty monkey-patching via reflection and eval)
  • The manage multiblock screen has a broken image in place of the i/empty placeholders

Add Subheading to block title

If a block (like activity results) has a heading, it should be displayed in the block title to be able to select the correct block if more blocks of the same type are added.

grafik

Drag and drop with side-by-side layouts

With side-by-side layouts, drag and drop doesn't position correctly, targeting the sub-blocks not the parent, and position gets lost during the failed drag.

The subblocks need to somehow not be targetable (with the parent being targetable) - perhaps, have the style not target to hide the parent block in editing mode.

Uninstall cleanup

When uninstalling the plugin cleanly, it should apply the split+delete routine to each multiblock instance.

Edit widget causes misalignment

Reported by Jakub.

When the title is left empty, the spacing is uneven in Edit mode.

image

It is also not aligned with the side blocks when in the center region:

image

Error when chaning dashboard for all users

I was testing this plugin on Moodle 3.9. When I added a multi block instance on my personal dashboard, everything worked fine. I tried to add in the site wide dashboard and got the following error:

Stack trace: 

    line 617 of /cache/classes/helper.php: coding_exception thrown
    line 958 of /cache/classes/loaders.php: call to cache_helper::hash_key()
    line 392 of /cache/classes/loaders.php: call to cache->parse_key()
    line 1553 of /cache/classes/loaders.php: call to cache->get()
    line 124 of /lib/classes/string_manager_standard.php: call to cache_application->get()
    line 327 of /lib/classes/string_manager_standard.php: call to core_string_manager_standard->load_component_strings()
    line 7387 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
    line 131 of /blocks/multiblock/classes/form/addblock.php: call to get_string()
    line 64 of /blocks/multiblock/classes/form/addblock.php: call to block_multiblock\form\addblock->get_sibling_blocks()
    line 214 of /lib/formslib.php: call to block_multiblock\form\addblock->definition()
    line 51 of /blocks/multiblock/manage.php: call to moodleform->__construct()

Multiblock templates

It would be neat to have admin-specified templates of sets of multiblock (ideally minus configuration requirements, so just having a list of blocks in their default states) that could be applied when creating a new multiblock.

For example, course calendar + navigation + section links + course progressbar + grades could be a typical course page template.

Visibility options

It would be good to be able to configure visibility for the block as a whole and potentially for each sub-block, e.g. to have a block added to the dashboard for admins, that is tagged admin-only.

Behat tests

Functional tests

  • basic tests
  • rearranging blocks
  • splitting out of multiblocks
  • merging into multiblocks
  • backup/restore (incl. block order)

Layout tests

  • tabbed
  • vertical tabbed
  • accordion
  • dropdown

Refactor the different layouts to be subplugins

Refactoring the different layouts to be subplugins would allow for new possibilities that the current rendering can't do because it has no ability to do them - for example, a 2/1 alternating with a 1/2 layout isn't feasible in the current setup because it has no way to safely identify which blocks should be what and where.

If each multiblocklayout was its own plugin, it'd be able to have its own renderer (or inherit a parent) that would handle the render pipeline and splice in any variables needed, like sequence numbers for the above example or otherwise alternate the Bootstrap class names.

Multiple block access rules

The principle access rules for blocks as mentioned in #22 are fixed but the “can this block be used multiple times” doesn’t check blocks by context appropriately... we can’t fix core but we can at least make add-block-inside-multiblock be context aware both at parent and child contexts.

Multiblock error when restoring a course

This error happened when, from a backup of my course, I tried to do its restore within a new course. The error was cleared when I disabled the blocks. I guess the error comes from Multiblock, because it had not previously happened to me until I inserted the blocks inside Multiblock.

I hope to be able to collaborate with the development of this excellent complement.

Multiblock error

Allow multiblock to contain multiblocks

There are few technical reasons left for this restriction. Mostly because it makes the UI annoyingly hard to deal with, and the backup/restore would need some love but it has an interesting potential.

Might be best to do the refactor for layouts as subplugins (#29) first before tackling this as the reason you might want to becomes more accessible at that point.

Course link/title displayed in breadcrumb when managing Multiblock content is wrong

Hi. Many thanks for this excellent plugin. I just wanted to report a bug which results in the wrong course link/title being displayed when managing a Multiblock's content:

Screen Shot 2020-05-31 at 11 14 27

The above shows the location of the Mutliblock in course 'Testing module', but when clicking the Mutliblock's 'Manage content' link...

Screen Shot 2020-05-31 at 11 14 41

...a completely different course/title is displayed in the breadcrumb trail.

We think this could potentially be quite confusing for teachers who rely on being able to click the course link in the breadcrumb trail in order to return to the course page they were working in.

Thanks again for your efforts and for sharing this plugin.

Inconsistent block access rules

Reported by Jakub.

For some reason, there seems to be a difference between the set of blocks available through the core Add block menu, and the Manage blocks in multiblock. If this is expected, perhaps it should be documented somewhere.

When on the dashboard:

Available core Available Multiblock Outcome
People This block is not present in the core Add block dropdown
Random glossary entry Cannot be selected in Multiblock Add dropdown
Recently accessed courses Cannot be selected in Multiblock Add dropdown
Recently accessed items Cannot be selected in Multiblock Add dropdown
Recent activity This block is not present in the core Add block dropdown
Recent blog entries This block is not present in the core Add block dropdown
Starred courses Cannot be selected in Multiblock Add dropdown
Timeline Cannot be selected in Multiblock Add dropdown

When in course:

Available core Available Multiblock Outcome
Multiblock As expected I guess
Section links Not available in Multiblock Add dropdown

Loosing activities - restored course

Hi!
We are almost loosing all the progression bars inside the multiblock (dropdown) when we restore a course. There is only 1 progression bar that remains in the multiblock. Moodle : 3.10 / Fordson : 3.10 / Multiblock : 3.9
Thank you

Daniel

Allow for suggested uses

In the configuration page where the tab layout is shown, it would be useful to provide optgroups for the options, splitting the options into "Recommended for sidebar use" and "Recommended for full width/dashboard use"

Split a multiblock out (on deletion?)

Firstly, add an option to split a child block out to the parent context from the manage contents screen.

Secondly, add an option on delete (somehow) to split each of the child blocks out into the containing context (similar to how Mahara - delete a collection and you still have all the pages)

Move this block into catalyst/ org git repo space

@Arantor do you have any objection to this? We are getting more traction on this in a few places and this will make it a bit simpler for everyone. Still happy to run with whatever workflow you prefer for reviews etc so you're still the maintainer

Dropdown mode doesn't work on full-width (e.g. dashboard)

Reported by Jakub,

When full-width (dashboard), the drop-down presentation mode is not tall enough to accomodate the config context menu, so the first item gets cut. This means one cannot configure the block, until one moves it to the side region where it resizes.

image

Admittedly, this is a silly way to use dropdown mode, but what if.

image

Moodle 3.5 support

While 3.5 is still supported as an LTS, we should probably support it. That said, there's probably no changes required, just it was built and tested on 3.6 and never tested on 3.5.

Add behat support for non boost themes

The lines

    # The usual 'And I add "Multiblock" block' step can fail in JS with lots of blocks present.
    And I select "Add a block" from flat navigation drawer
    And I click on "Multiblock" "link"

are not necesary and can be replaced by the default method to create a block.

And I add the "Multiblock" block

This way, non boost based themes without a navigation drawer can also be tested. I did the changes with a classic based theme, and all tests pass.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.