Blocks

Help!

 
 
Tim at Lone Pine Koala Sanctuary
Help!
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers
Does anyone know why, if a block says that it can support multiple instances on one page, admins get a chance to disable that on the Manage Blocks page? (I am taking about the Multiple column in the table on Administration ► Modules ► Blocks ► Manage blocks.)

I don't think I have ever seen an explanation of why this is necessary, nor I can't work out why it is required. Getting rid of it would make things a bit simpler, so I would like to do so if possible.*

I can't find any mention of this in the tracker. In CVS history, this was added on 20th October 2004 as part of this commit. Since that is just one part of a big change, there is no specific mention of the rationale for this feature.


* Why I am considering changing this? Well, if you keep an eye on the Moodle 2.0 Roadmap, or follow the General Developer Forum, you will know that we are thinking about possible changes to Blocks / Pagelib / Navigation. That Moodle Docs page links to various relevant forum discussions in the General Developer Forum.
 
Average of ratings: -
Ray Lawrence
Re: Help!
 
I can't imagine that this would be a great loss. I've never found a need to change the status, but it's not possible to imagine every use case.
 
Average of ratings: -
I'm Gumby, Dawmit!
Re: Help!
 
I assumed not allowing multiple instances would eliminate duplicate blocks in cases were blocks were individually added and then maybe sticky blocks were later applied. Users wouldn't have to individually delete all the duplicate instances they added. (That actually occurred to me AFTER having gone through just a hunt- find-delete-duplicate scenario *lol*)

I just tested that theory and it does work that way:
  • Added the Tag block to a course page
  • Then set Tag block as sticky on course pages
  • Now two instances on the same page
  • Changed Tag block allow multiples to 'No'
  • Went back to course, both blocks still there, called resetblocks.php
  • Only stick block remains
I noted too that when multiple is set to 'no.' if the block already exists on a page, it will not appear in the dropdown add blocks menu.

Sidenote: The Modules>Manage Blocks page can be a bit confusing - you have a column of instances (that may include 100s), then you have the allow/disable multiple - it could easily be interpreted that changing to 'no' would eliminate all but one instance sitewide. The docs clarify otherwise, but if the option remains in Moodle 2, changing the heading to "multiple on same page" might be more user-friendly.
 
Average of ratings: -
I'm Gumby, Dawmit!
Re: Help!
 
PS - As noted, with multiple set to 'no,' and the block already exists on a course page, it's not available in the add blocks menu (even for admin). This seems to apply regardless of how the block got there (individual placement, sticky, defined in config.php), and remains so whether the block is visible or hidden.

I can think of a few situations where preventing desired multiple instances might warranted: Say you have a dictionary, glossary or wiki block on My Moodle or course pages and you want to hide it during exams. Not having it available in the drop-down would, in theory, prevent students from adding another one after you hide the first one.

However, I just tested that (and think myself fairly clever for finding more productive ways to procrastinate this morning's tasks *lol*) and there seems to be an exception to the rule for My Moodle sticky blocks (whether hidden or visible). In looking at it, that would be the only page of concern in the above example, since students already can't add blocks to course pages. So for this situation, the opinion makes sense, but it doesn't follow through to where it would matter. ('Course hiding a My Moodle sticky would apply to everyone site-wide, but that's a different matter.)

I guess I should get back to work...mixed
 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Help!
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers
That is an important use-case. Lots of manually added blocks. Then you decide to add one sticky block instead, and you want to remove the old separate instances.

However, I don't think fiddling with the allow multiple admin option is the best user interface we could have for this task. It is completely unintuitive.

So, it still looks like we can remove that admin option, if we replace it with something better.
 
Average of ratings: -
I'm Gumby, Dawmit!
Re: Help!
 
I certainly agree. Only after manually deleting (most) duplicate instances did that possible function occur to me. A 'hunch' is in no way intuitive when dealing with a user interface.

Maybe this would be better applied to sticky block management? Since this task relates directly to setting stickies and avoiding duplicates, it seems a logical place. 'Course, this is probably what you already had in mind *lol*

It would also be the natural place to address the loophole I mentioned in my last post (that 'prevent multiple instances' is ignored by My Moodle page stickies). This would be a useful function - if it worked with the My page - but it would be significantly more useful if it could be configured in other contexts (as proposed on Development:Navigation Blocks/pagelib).... But I guess I should post comments about that on the other forum smile
 
Average of ratings: -