Blocks

 
 
Picture of Steve Bailey
More problems with "Sticky" blocks in 2.2
 

Hi all,

A quick check of the existing threads on this tells me I'm not the only one confused by the new way of making blocks "sticky" (in the 1.9 parlance). However, I seem to have a different issue to others.

We are in the preparation stages of moving from 1.9 to 2.2 and my colleagues and I have been tasked with setting the configuration. We want to keep our settings as similar as possible to our current 1.9 instance to minimise confusion and, therefore, training required. We currently have a number of sticky blocks on course pages (e.g. Calendar, Activities, Administration, People) and I can find no way of replicating this setup without adding these blocks to a level above the main course page. It seems to do this I must add the blocks to a category or the site home (if I want them to appear in *every* course), but firstly this does not compare well with our current setup and secondly many of those blocks are not relevant outside of the course context.

Can anyone tell me how to do this without changing core code? I should also note that we don't want users to be able to move or delete these blocks.

Any advice much appreciated. Steve

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: More problems with "Sticky" blocks in 2.2
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

Yes, you have to add the block at a level above the course page to get it to appear on all courses. However, that does not necessarily mean that is appears on every page, becuase you can also set the type of page that the block should appear on. So, try setting the block to appear on

  • System context, and all subcontexts; and
  • page type course-veiw-*
 
Average of ratings:Useful (2)
Picture of Steve Bailey
Re: More problems with "Sticky" blocks in 2.2
 

Thanks Tim, but that's not what I'm seeing. When I add a block onto the site home (front page) and edit the settings the options I have for page contexts are:

  • Display on the front page only.
  • Display on the front page and any pages added to the front page.
  • Display throughout the entire site.

There is no separate "page type" option. When adding the block to a category instead (which would necessitate the creation of a top-level category simply for this purpose) I have the following contexts:

  • Display on [this category] and any pages within it.
  • Display on [this category] only.

...along with "Display on page types":

  • Any site administration page.
  • The current site administration page.
  • Any page.

So I'm not given the option of just adding to course main pages from there either. The only place this option appears to me is when adding a block to a course page which then, as expected, doesn't proliferate to all other courses.

Could it be a config option that I've missed, or could our Moodle instance be broken?

I've also noticed another issue, in that even when a block is added to the front page and deletion is prevented in the Blocks admin page, the cascaded block in the course page can still be moved and hidden by the teacher. I've tried prohibiting this using role overrides at the site context but this makes no difference. I assume I'd have to add a role override in each course, which obviously isn't possible (we have several thousand courses each year). The alternative would be to prevent teachers from editing blocks at all but that's not reasonable; we currently (in 1.9) have sticky blocks on the left, for continuity of the student experience, and allow teachers to add blocks below them on the left or in their own hierarchy on the right. Our developers want to avoid core code changes but I don't see an alternative in this case.

Steve

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: More problems with "Sticky" blocks in 2.2
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

This is where we hit the problem that the UI is incomprehensible. Try this:

  1. Add the block to the front page.
  2. Set it to be shared "throughout the entire site"
  3. Now go to a coures page and edit the block.
  4. And set it to be shown on course pages only.
 
Average of ratings:Useful (5)
Picture of Steve Bailey
Re: More problems with "Sticky" blocks in 2.2
 

Thanks Tim, that worked perfectly. Very confusing!

I was hoping that would work for the role override as well but alas no. Looks like a core code change, or "local plugin", is the way forward for that then.

Thanks again. You are truly the Moodle Sensei [bows in awed respect]. Steve

 
Average of ratings: -
Picture of Steve Bailey
Re: More problems with "Sticky" blocks in 2.2
 

I've also noticed that when you make the change in the course page it removes the block from the front page. Keeps things nicely tidy but confuses the hell out of me wink

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: More problems with "Sticky" blocks in 2.2
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

The system was designed to be maximally flexible (considering what was possible with one database query) not maximally comprehenisble.

 
Average of ratings: -
Picture of Gus Hagelberg
Re: More problems with "Sticky" blocks in 2.2
 

When I'm logged in as an administrator and I add a block to the front page I get the option "Display on page types: Any site administration page" or "the current site administration page" and not "throughout the entire site".

Any ideas why or what I need to do?

 
Average of ratings: -
Picture of Helen Foster
Re: More problems with "Sticky" blocks in 2.2
Group DevelopersGroup Documentation writersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Hi Gus,

I just tried on http://demo.moodle.net logging in as an admin and adding different blocks to the front page then editing them. In each case I could select 'Display throughout the entire site'. Thus I'm mystified as to why you can't see this option. Can you try and see whether you can reproduce the problem on http://demo.moodle.net.

 
Average of ratings: -
Mary Cooch
Re: More problems with "Sticky" blocks in 2.2
Group Documentation writersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup TestersGroup Translators

Gus - I think you are looking at site admin pages and trying to add your block from there (for instance I tried adding a block on the notifications page and I got the same as you, but when I went to the actual front page to add my block I got the same as Helen. ) By the way I am sure previously you could add sitewide blocks via admin pages but perhaps it has now changed.

 
Average of ratings: -
Picture of Philip Watland
Re: More problems with "Sticky" blocks in 2.2
 

Hello,

Is there way to make the blocks added as you indicate not removable by teachers?  I want to create a standard template with certain blocks in certain locations.  I can set it up so the blocks and block locations are default but I cannot see how to make them 'stick' as I could with 1.9.

Any help appreciated.

Philip

 
Average of ratings: -
Mary Cooch
Re: More problems with "Sticky" blocks in 2.2
Group Documentation writersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup TestersGroup Translators

If you set blocks as site wide then teachers in individual courses won't be able to delete them because they won't have the delete icon (You will , as admin) 

 
Average of ratings:Useful (1)
Picture of Philip Watland
Re: More problems with "Sticky" blocks in 2.2
 

Thank you for your reply. 

Yes, I agree, however as best as I can tell a teacher can still hide and move these site wide blocks.

I am hoping there is some way to remove the option to hide and move certain blocks while still allowing for other non-sticky/frozen blocks to be added and located by teachers.

Philip

 
Average of ratings: -
Picture of Steve Bailey
Re: More problems with "Sticky" blocks in 2.2
 

I'm afraid I found that too, and I can't see a way around it without some development work. We need the "sticky blocks" to be in the same location (and visible) in all courses so that the students have a unified experience, whilst allowing teachers to add their own blocks around them to allow for personalisation and innovative use. I'm going to ask our developers to look into it and hopefully they'll share their solution.

 
Average of ratings: -
Picture of Philip Watland
Re: More problems with "Sticky" blocks in 2.2
 

Hi Steve,

I was wondering if you have you been able to find a solution to this?  Until I can set up a course template in Moodle 2.2 as I could with 1.9 and sticky blocks I am reluctant to move to 2.2.

Philip

 

 
Average of ratings: -
Picture of Steve Bailey
Re: More problems with "Sticky" blocks in 2.2
 

Hi Mary,

Not sure if I got confused on this, but that wasn't my experience. I found that teachers could delete the blocks in their own courses. What I had to do was prevent block deletion using the padlock icons on the "manage blocks" admin page. This stops teachers from deleting any block added to the site home page, with the aforementioned caveat that they can still move and hide them.

 
Average of ratings: -
Picture of Shawn Drake
Re: More problems with "Sticky" blocks in 2.2
 

This new system is incredibly frustrating and very, very unintuitive. Tim, you gave a great explanation of how to make this work here, but as another user mentioned, what about blocks that only work in a specific context? We have blocks that we want to appear on every course page, but they just don't belong at site level. It would be even better if we could set them at category level, but we're having issues with that as well. Every time we set the block (at category level) to "Display on 'Category: This Category' and any pages within it", it never saves this setting and always reverts back to "Display on 'Category: This Category' only. Thoughts?

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: More problems with "Sticky" blocks in 2.2
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

I don't understand why it will not save that setting. Sorry. It should work.

 
Average of ratings: -
Picture of Shawn Drake
Re: More problems with "Sticky" blocks in 2.2
 

Do you happen to know if it relies on another setting somewhere else? 

 
Average of ratings: -
Picture of Graeme Boxwell
Re: More problems with "Sticky" blocks in 2.2
 
Hi Shawn, We are getting the same when we try to add a block to a particular category. The method above works to add one to all sites, but it would be useful to be able to add just to a single category as well. Graeme
 
Average of ratings: -
Picture of Shawn Drake
Re: More problems with "Sticky" blocks in 2.2
 

Agreed, Graeme. If I'm able to figure this out on my own, I'll be happy to post back what I find. As it stands, though, I'm running out of ideas and hoping someone here will be able to fill in the gaps for me.

 
Average of ratings: -
Picture of Yolanda Ordóñez Rufat
Re: More problems with "Sticky" blocks in 2.2
 

There's a tracker issue open for this: MDL-31616

And should be a good idea to check the MDL-30340 issue before triying to fix the problem.

The workaround, fixing the value in the database manually, works fine even if you edit the block. That should narrow the issue.

 
Average of ratings:Useful (2)
Me
Re: More problems with "Sticky" blocks in 2.2
 

Hi all,

It looks like the 'page context' information isn't being copied from the block configuration page when you save the changes. I've added a comment to the tracker describing how I just fixed it.

Hope this helps,

Ian.

 
Average of ratings:Useful (1)