Side Bar Block

Side Bar Block

by Justin Filip -
Number of replies: 106
This was created for a client who has allowed it's release to the community and basically emulates the functionality of the site main menu block with a few extra tricks for display within a course.

We're having some issues putting it in contrib but it should eventually be available at contrib/block_side_bar from the main CVS repository. For now you can download the attached file.

Enjoy!  Any feedback is appreciated.



From the Readme file:

This block allows you to create separate activities and resources in a course
that do not have to appear in course sections. The block can have multiple
instances of it within a course - each instance will have its own unique group
of activities and resources. Each instance can also have its own configured
title.

It functions by creating course sections for each instance, starting at a number
beyond what would normally be used by a course. This defaults to section 1000,
but is configurable at the global level.

All resources and activities within a block can be edited and moved around just
like normal activities when editing is turned on. Adding label resources allows
you to add text to the blocks as well.

In a sense, this block combined the main menu block functions and HTML block
functions into one block that can be used in a course.

Average of ratings: -
In reply to Justin Filip

Re: Side Bar Block

by Justin Filip -
Update: It's now avaiable in contrib/block_side_bar.
In reply to Justin Filip

Re: Side Bar Block as a Sticky block

by Paul Oliphant -
Justin,

I'm finding problems with using the side bar block as a sticky block.
1) WARNING: When the Side Bar block is added as a sticky course block, each time any course page is viewed (by admin, teacher, or student) a new section is created for each sticky side bar block. The generated section are over the 1000 section number defined for the first Side Bar block section. If you aren't careful this can create a LARGE number of these hidden section very quickly. Removing the sticky sidebar blocks does not remove the created sections.
2) Added content to a sticky side bar block is never displayed.
3) Content can be added to a sticky block from a course site. When it is the new content is attributied to that course site sections not the global site (course id = 1).

These bugs may have common root causes. I'm using Moodle 1.8 and your latest build of side bar block.
- Paul
In reply to Paul Oliphant

Re: Side Bar Block as a Sticky block

by JoseRey Alo -

'ello all,

I hope this isn't such a big problem. I added a test resource via the side bar but now I can't get to edit it. Any fix here? btw, I'm using 1.8 with the latest build of side bar. tnx.

::joserey

In reply to Paul Oliphant

Re: Side Bar Block as a Sticky block

by Đặng Quang Hùng -
Hi all,
Do you find any modifications to prevent section creation each time any course page is viewed as the 1) Warning now?
In reply to Justin Filip

Re: Side Bar Block

by Simon Bryan -
Looks quite good and I think will be useful. The only issue I have is that unzipping it did not put it in it's own side_bar folder, I needed to create that myself and then install the files. I also didn't test but out of habit put hte lang file in moodle/lang/en as well - is this needed?
In reply to Simon Bryan

Re: Side Bar Block

by Justin Filip -
Actually it will create the directory structure for you so long as you specify that to whatever you are using to unzip the archive (like it says in the README file inside the archive).

The structure is:

/blocks/side_bar/lang/en/block_side_bar.php
/blocks/side_bar/block_side_bar.php
/blocks/side_bar/block_side_bar-README.txt
/blocks/side_bar/config_global.html
/blocks/side_bar/config_instance.html


In reply to Justin Filip

Vast: Re: Side Bar Block

by Petri Niemi -
Hi Justin

Is this compatible with Moodle 1.6?
In reply to Petri Niemi

Vast: Re: Side Bar Block

by Petri Niemi -
Or maybe I just try it smile Seems to work very nicely in my very short test with 1.6.
In reply to Petri Niemi

Re: Vast: Re: Side Bar Block

by Justin Filip -
Thanks for testing trying it out!

The client this was made for is using a 1.5 install and we hadn't tested it on 1.6 yet.  That's good to hear.
In reply to Justin Filip

Re: Side Bar Block

by N Hansen -
How is this different from Chardelle's block?
In reply to N Hansen

Re: Side Bar Block

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
It may not be - I haven't tried the other.

This one can have as many instances added to a course as you like, and each one will contain its own activities in its own section. It automatically determines the sections for each block. Also, you can globally configure which section number to start with (each new course instance increments this section).

mike
In reply to Justin Filip

Re: Side Bar Block

by Alexander Kuo -
It's really good and helps me a lot!
But, it is a pity that this side_bar_block will disappear after I change the setting of my course. Oh, it really tortures me NOW! Is it a bug or just I made some mistakes?
My Moodle's version: 1.5.3+
In reply to Alexander Kuo

Re: Side Bar Block

by Justin Filip -
Hi Alexander,

You were probably using the code I first posted to the forum.  That was fixed early on.  But I have made another big improvement to the block code.  Now it will delete any resources or activities that it creates, along with the course section, when you delete an instance of the block.

Use the code attached to this post (as should anyone using this block) and it should fix the problem you are having.
In reply to Justin Filip

Re: Side Bar Block

by Matt Cromwell -
I downloaded the Side Bar from CVS and really like the idea of it in general. But here's one scenario which we can't get it to work with:

We want to make sure students login everyday, so we created an "Assignment" called Attendance. We want it to be in the Gradebook but not anywhere in the center block area. The Side Bar seems like the perfect option, except that all Assignments that are in the Side Bar only show up as "Uncategorized" and will not show up in the "Set Categories" tab so that we can actually categorize them. Once an assignment is taken out of the Side Bar and placed into the central area, it can be categorized. Otherwise, we constantly have to show this "Uncategorized" area in the grade book and can not weight it or anything. It's quite frustrating.

Is there a way around this? Any suggestions would be welcome.

~MC~
In reply to Matt Cromwell

Re: Side Bar Block

by Justin Filip -
Hi Matt,

I'm checking this out.  Kind of busy at the moment but I've read your post and want to fix this and a few other issues I discovered while beginning to investigate your problem.  Hopefully I should have something figured out by the end of this week.

Thanks for the feedback.
In reply to Matt Cromwell

Re: Side Bar Block

by Justin Filip -
Okay.  I have a solution for your problem.

The issue is that when the gradebook is looking for course modules that can be assigned to a grade category it only looks through the defined number of sections in the course (as defined in the Course settings).  As in, if you're using the Weeks course format and you define 10 weeks, it will only look through 10 sections.

From /grade/lib.php - grade_set_categories():

for ($i=0; $i<=$course->numsections; $i++) {

    if (isset($sections[$i])) {   // should always be true
        $section = $sections[$i];
...

If you change it to:

foreach ($sections as $section) {

If will index the activities that were created using the Side Bar Block as they are outside the defined number of course sections.

Anyway, I attached a patch for the /grade/lib.php file that implements this change if you'd like to use it.  I'm going to see if I can't get this change into the main distribution as it makes sense to go through any section that exists for the course.

There is another issue where the block is creating two new sections and only using the second one when you add a new instance.  I'm still trying to fix that issue.
In reply to Justin Filip

Re: Side Bar Block

by Matt Cromwell -
Sorry Justin, I've recently been posting quite a bit, and the gradebook issue was not at the top of my list, so I kinda forgot about this post. But, now that I come back to it I'm so glad that you've been dealing with this issue.

My problem now is that I have no idea how to apply a patch. Can you apply patches on a Windows server?

I tried to copy/paste the plus/minus lines manually and the result broke the gradebook. Though I'm a little nervous to implement a change to the gradebook -- for the sake of the sideblock-- I'd be willing to at least try it out, if you could help me figure out how to apply the patch.

Thanks!
~MC~
In reply to Matt Cromwell

Re: Side Bar Block

by Justin Filip -
Well 'patch' is a UNIX tool that takes the file I gave you and would add it's changes to another specified file.  There should be a patch compiled for Windows.  But here is a copy of the patched file you could try running on your server (after backing up the original, of course).  It's the /grade/lib.php file attached to this post.


In reply to Matt Cromwell

Re: Side Bar Block

by Justin Filip -
You can download patch, compiled for win32, here:

http://gnuwin32.sourceforge.net/downlinks/patch-bin-zip.php

And you would use it by changing to the /grade/ directory, copying the patch there, and running:

patch lib.php patch-grade_lib.php

If you wanted to reverse the patch (and restore lib.php to it's original state), run:

patch -R lib.php patch-grade_lib.php

Hope this helps!

In reply to Justin Filip

Re: Side Bar Block

by Mr. Marc -

Will this allow a block to be used in every course and the main menu?

If now does any one know how you can make a block of items always follow or be in every course?

Thnak you for your help!

In reply to Justin Filip

Re: Side Bar Block

by Laura Malmi -
Hi,

a little bug came up when changing the title of the side bar (configuring side bar block). If there are any resources or activities included in side bar they will disappear after saving the new title. This is because a new row is inserted into mdl_course_sections table without the information about resources included in side bar.

We fixed this problem by adding a hidden field in side_bar/config_instance.html:
<input type="hidden" name="section" value="<?php echo $this->config->section; ?>" />
This way the data in mdl_course_sections table won't change.

- Laura
In reply to Laura Malmi

Re: Side Bar Block

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
This bug was already fixed in the version in CVS. We just forgot to mention it (blush). Thanks for pointing it out.

mike
In reply to Justin Filip

Side Bar Block - Bug?!

by Charlie Owen -
I've just been alerted to a bug by one of our users.

Add a Side Bar. Add some content. Then try moving a topic in the central column up or down. On our server it results in the content of the Side Bar being deleted!

The content is still there if you look in the MySQL database, it's just the Side Bar loses the link to it.

I've tried this on two seperate servers (1.6.1, both upgrades from 1.5.2) with the same behaviour. I haven't got access to a fresh 1.6.1+ install just yet, but I'll try it and report back as soon as possible.
In reply to Charlie Owen

Vast: Side Bar Block - Bug?!

by Jani Lemmetyinen -
Hi Charlotte,

sounds similar to what I have met when editing Side Bar (look Laura's message earlier in this thread)

Add Side Bar. Add content. Change Side Bar name in Configuring Side Bar Block. Result: all content deleted. Content can be found if I look Resources. It seems that editing brokes links between Side Bar and its resources.

This has happen several times both Moodle 1.5.3 and 1.6.1+

- Jani -
In reply to Charlie Owen

Re: Side Bar Block - Bug?!

by Charlie Owen -
I've confirmed that this bug occurs on a fresh install of 1.6.1+ and using the side bar block from contrib. sad
In reply to Charlie Owen

Re: Side Bar Block - Bug?!

by Charlie Owen -
It seems that when you move a topic (and hence alter the course_sections table in the moodle database) the "section" field in the table gets changed from 1000 (the default for a side bar) to a number one larger than the second-largest "section" field in the table!

Change the field back to 1000 and the content of the block is restored.

Sounds like some auto-increment function in Moodle is going wonky (to use technical speak).
In reply to Charlie Owen

Re: Side Bar Block - Bug?!

by Charlie Owen -
I've just had another look and I think I've tracked the problem down to a piece of code beginning on line 1513 of /course/lib.php.

    // Check for duplicates and fix order if needed.
    // There is a very rare case that some sections in the same course have the same section id.
    $sections = get_records_select('course_sections', "course = $course->id", 'section ASC');
    $n = 0;
    foreach ($sections as $section) {
        if ($section->section != $n) {
            if (!set_field('course_sections', 'section', $n, 'id', $section->id)) {
                return false;
            }
        }
        $n++;
    }

Commenting this out prevents the bug I've talked about but will likely create problems of its own!
In reply to Charlie Owen

Re: Side Bar Block - Bug?!

by Justin Filip -
Hi Charlotte,

I fixed the problem you found.  As the courselib.php code is automatically 're-numbering' course sections, I've stored the ID value of the course_sections database record in the block config also.  I just do a check to verify that the section value stored in the block config (i.e. 1000) matches what the database says it is for that particular course record.  This solves the problem.  This update will also 'upgrade' existing blocks to store this new piece of information as well so that you don't need to replace all your existing instances of the block.

Here is the patch for it (I've also attached the new copy of block_side_bar.php if you don't know how to use patch and just want to drop the working file in).  I'll post another comment here when the fix is in contrib CVS, too.

Index: block_side_bar.php
===================================================================
RCS file: /cvsroot/moodle/contrib/block_side_bar/blocks/side_bar/block_side_bar.php,v
retrieving revision 1.5
diff -u -r1.5 block_side_bar.php
--- block_side_bar.php 10 Mar 2006 01:23:15 -0000 1.5
+++ block_side_bar.php 13 Sep 2006 03:23:45 -0000
@@ -57,9 +57,10 @@
$section_start = $CFG->block_side_bar_section_start;

/// Create a new section for this block (if necessary).
- if (!isset($this->config->section) or empty($this->config->section)) {
- $sql = "SELECT MAX(section) as sectionid FROM `" . $CFG->prefix .
- "course_sections` WHERE course='" . $this->instance->pageid . "'";
+ if (empty($this->config->section)) {
+ $sql = "SELECT MAX(section) as sectionid
+ FROM `{$CFG->prefix}course_sections`
+ WHERE course='{$this->instance->pageid}'";
$rec = get_record_sql($sql);

$sectionnum = $rec->sectionid;
@@ -82,11 +83,31 @@
error('Could not add new section to course.');
}

- $this->config->section = $section->section;
+
+
+ /// Store the section number and ID of the DB record for that section.
+ $this->config->section = $section->section;
+ $this->config->section_id = $section->id;
parent::instance_config_commit();
} else {
- $section = get_record('course_sections', 'course', $this->instance->pageid,
- 'section', $this->config->section);
+
+ if (empty($this->config->section_id)) {
+ $section = get_record('course_sections', 'course', $this->instance->pageid,
+ 'section', $this->config->section);
+
+ $this->config->section_id = $section->id;
+ parent::instance_config_commit();
+ } else {
+ $section = get_record('course_sections', 'id', $this->config->section_id);
+ }
+
+ /// Double check that the section number hasn't been modified by something else.
+ /// Fixes problem found by Charlotte Owen when moving 'center column' course sections.
+ if ($section->section != $this->config->section) {
+ $section->section = $this->config->section;
+
+ update_record('course_sections', $section);
+ }
}

if (!empty($section) || $isediting) {

In reply to Justin Filip

Re: Side Bar Block - Bug?!

by Charlie Owen -
I've applied this to our test server and it works perfectly. Thank you!

(Woo yay! My name is in a piece of code! big grin)
In reply to Justin Filip

Vast: Re: Side Bar Block - Bug?!

by Jani Lemmetyinen -
Hi Justin,

testing your patch. It fixes the bug, but when I backup and restore course, there are following unexpected results:
1) Backup/restore deleted all side bar content.
2) Side bar is hidden in normal view, shown only when editing on
3) If I try to add new activities or resources to side bar  I cannot see them on side bar. I can access them via course resources/activities but not directy via side bar.

Backup and restore processing was mostly OK, but there were 2 or 3 times when error "Notice: Undefined variable: info in/opt/lampp/htdocs/ari/backup/restorelib.php on line 833
Error creating sections in the existing course.
An error has occurred and the restore could not be completed!"
Result: course with empty course sections.

We have found some similar problems with Nwiki in backup/restore. See this thread: http://moodle.org/mod/forum/discuss.php?d=51536

Our Moodle is 1.6.1+

- Jani -

In reply to Jani Lemmetyinen

Re: Vast: Re: Side Bar Block - Bug?!

by Justin Filip -
Hmm, Moodle really doesn't want people just creating arbitrary section numbers in their courses and populating them with activities/resources, does it?

When you said "Backup and restore processing was mostly OK" did you mean before the patch was applied or is this with the patch?

I'll examine the main backup/restore code to see if it's doing something unusual when it comes to handling courses and sections.
In reply to Justin Filip

Vast: Re: Vast: Re: Side Bar Block - Bug?!

by Jani Lemmetyinen -
Hi Justin,

When you said "Backup and restore processing was mostly OK" did you mean before the patch was applied or is this with the patch?
- It was with the patch.

Laura Malmi notice later following: if rename side bar (in configuring side bar) after course restore, side bar content was shown again and side bar was not hidden anymore (in normal view).

- Jani - 
In reply to Jani Lemmetyinen

Re: Vast: Re: Side Bar Block - Bug?!

by Justin Filip -
Hi Jani,

I've fixed your bug.  I added another configuration variable to each block instance the store the course ID of the course the block is in.  It then checks to make sure that the course ID the block has saved is, in fact, the same as the course ID it is currently residing in (they would be different after a restore was done).  If it's different, the block will store the new course ID value and also change the value its storing for the 'course_sections' record ID (as a new record is created for this section in the new course).

As with my fix for Charlotte's problem, this should 'upgrade' existing blocks.  In fact, if you use the new code and just refresh a restored course (which isn't showing the blocks) they should appear right away for you.

I also found that resources/activities created by the block weren't being properly removed if an instance of the block was deleted so I added that fix in as well.

You can find this new code in my post at the bottom of this thread.

Thanks for letting me know about this issue.
In reply to Justin Filip

Vast: Re: Vast: Re: Side Bar Block - Bug?!

by Jani Lemmetyinen -
Hi Justin,

thank you fixing this bug. Next we test your new version and I'll report here if there are any problems.

- Jani -
In reply to Justin Filip

Re: Vast: Re: Side Bar Block - Bug?!

by Charlie Owen -
I can confirm that with the latest code I can successfully backup and restore courses that contain Side Bars. big grin
 
In reply to Charlie Owen

Vast: Side Bar Block - Bug?!

by Jani Lemmetyinen -
Hi Charlotte and Justin,

I confirm this bug at our site (1.6.1+) just as you described. We try to fix it using Justin's patch.

- Jani -
In reply to Justin Filip

Re: Side Bar Block [NEW VERSION!]

by Justin Filip -
I thought I'd post a new zip file for the block that contains all the latest fixes, including:
- course sections created with an instance of the block won't be automatically renumbered by code elsewhere.
- course modules created by the block are properly removed when an instance of the block is deleted
- the block's sections and course modules will persist during the backup/restore process

Thanks for using it and letting me know about the bugs you're finding everyone!

The zip file attached to this post can just be unziped into your /blocks/ directory (and overwrite any existing /blocks/side_bar/ files).
In reply to Justin Filip

Re: Side Bar Block [NEW VERSION!]

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Hi, Justin.

Thanks for the contribution, but can you please not code in the forums? It gets old quickly and clogs up the server, plus people get confused about versions.

In general it's much better to host it on a web site or get it into cvs:/contrib and then link to it from an entry in the Moodle modules database. In your case, because it's in contrib already, the download link is always http://download.moodle.org/download.php/modules/block_side_bar.zip (archive updated daily)
In reply to Martin Dougiamas

Re: Side Bar Block [NEW VERSION!]

by Justin Filip -
Sorry, Martin.  I don't have contrib access so this was my less-than-optimal solution to the problem. I'd much rather be doing it that way, though.
In reply to Justin Filip

Vast: Re: Side Bar Block [NEW VERSION!]

by Jani Lemmetyinen -
Hi Justin,

we tested your new version in 1.6.1+ and 1.5.4. Everything was perfect in 1.6.1+, but in older Moodle version we have noticed that side bar seems to create several (like 10-15) extra course sections after backup and restore. This has happen couple of times with older side bar version, and only one time with this new version. Unfortunaly I cannot reproduce this bug and I'm not really sure if its side bar or something else?

In our Moodle 1.5.4+ (2005060240) we have following non-standard modules: dfwiki (2006020301) and new wiki (2006041201) and non-standard blocks: Skype contact (2005121300), Quote of the day (2005031300) and Live stats (2006150300).

- Jani -
In reply to Jani Lemmetyinen

Re: Vast: Re: Side Bar Block [NEW VERSION!]

by Justin Filip -
Hi Jani,

I tried to reproduce this bug on my own using 1.5.4+ and was not successful.  Perhaps it's something else in the list of add-ons that you're running which is the cause.
In reply to Justin Filip

Another bug - titles of hidden Side Bars

by Charlie Owen -
You're gonna love me for reporting all these bugs!

Bug: A teacher hides a Side Bar block that has a custom title, but the title is then replaced by "Side bar"!

For teachers that have multiple hidden side bars this makes it very hard to tell what each one contains.
In reply to Charlie Owen

Re: Another bug - titles of hidden Side Bars

by Justin Filip -
Hi Charlotte,

That's an easy fix and just the result of me setting the custom title in the wrong place.  I'll e-mail the fix to you until I can get some CVS access to make these changes myself so that everyone can benefit from them.

Thanks, again (really! smile).
In reply to Justin Filip

Vast: Re: Another bug - titles of hidden Side Bars

by Jani Lemmetyinen -
Hi Justin,

verified this funny bug as well (both 1.5.4 and 1.6.1+). When I click hidden side bar to make it visible again, I get also my custom title back.

Could you please email this fix to me as well.

- Jani -
In reply to Justin Filip

Re: Another bug - titles of hidden Side Bars

by Anil Sharma -

Hi Justin

The sidebar block is very useful and would be more useful if it also appeared in the default moodle course.  What we use SideBar for is to create activities in it, hide the entire block and Link those activites in the center column. This allows better design flexibilty.

The 'Main Menu' block on the default course, if hidden, also hides all the activites inside it.  Therefore, it can't be used the same way as SideBar.

Can I request you to make the minor change so that Sidebar is also available in the default course ?

In reply to Anil Sharma

Re: Another bug - titles of hidden Side Bars

by James . -
+1 (big time)
I think the way moodle can't have "hidden but active" resources is one of the worst things about it.
In reply to James .

Re: Another bug - titles of hidden Side Bars

by Justin Filip -
Hi James and Anil,

I just committed to CVS a change that will allow the block to be added to a site's main index page. I also tested the block myself by adding an activity, hiding the block and accessing it directly and it worked fine.

So if you update to the latest code in CVS you will have this feature.

Thanks for the request and sorry it took so long to implement.
In reply to Justin Filip

Re: Another bug - titles of hidden Side Bars

by James . -
Great news - and from my point of view it was merely overnight - no huge delay at all smile
In reply to Justin Filip

Re: Another bug - titles of hidden Side Bars

by Justin Filip -
Actually, I shouldn't say "took so long to implement", it should read: "took so long for me to get around to implementing."
In reply to Justin Filip

Re: Side Bar Block

by Paul Nijbakker -
This block would be useful if it could be added on the MyMoodle page.

Rgrds,
Paul.
In reply to Paul Nijbakker

Re: Side Bar Block

by Ray Lawrence -
Hi Paul,

I made a request for this block to be considered for inclusion in the core Moodle yesterday. You can vote for this at MDL-9414.
In reply to Ray Lawrence

Re: Side Bar Block

by Justin Filip -
+1 from me. wink
In reply to Justin Filip

Re: Side Bar Block

by Ray Lawrence -
Hi Justin,

Any info you can add to the feature request which will help the evaulation process would be great. approve

I noticed some comments in the plugins database about back ups if the block is renamed.

It's at MDL-9414 if anyone else would like to vote for this......
In reply to Ray Lawrence

Re: Side Bar Block

by Justin Filip -
Ray,

I believe those comments were from the initial code release and we've fixed a lot since then and have been using it on client site's for quite some time now but I'll do another check to verify that it's all working still and maybe put some info about how it works into MoodleDocs.
In reply to Justin Filip

Re: Side Bar Block

by Ray Lawrence -
Justin,

That's great. Yes This is all good news. Anything you can add to the tracker item would be great too.
In reply to Justin Filip

Re: Side Bar Block - not working in 1.9 ?

by Anil Sharma -
Justin

In the latest 1.9 moodle, the sidebar block gets installed but doesnt appear in the drop down list to add a block. I think the block needs some update

TIA

Anil
In reply to Ray Lawrence

Re: Side Bar Block

by Myrrh Lynn -
Hi Ray,
I voted for this too. I need this one. I downloaded the version on the modules and plugins page and it doesn't work.
It says: Module "block_side_bar" is not readable - check permissions

Was this the latest version? I saw on Tracker that you said the latest version was here: contrib/plugins/blocks/side_bar but I don't know where this is.

Not sure if there is something wrong with the version or with the way I'm having to install modules and themes.

So far, I have tried to download 3 different modules. When I click on any download link, it takes me to my own computer files instead of the server files where Moodle is located.

I'm having to create empty folders on my server and then upload individual files into them. I have tried to upload actual folders from my computer, but I can't. The only things that have successfully worked with this method have been some themes.

I'm not sure what I need to do. I'm not a programmer and this is my first website also. Is there something I need to configure that I haven't? If so what and where do I find it?




In reply to Myrrh Lynn

Re: Side Bar Block

by Ray Lawrence -
Hi,

Could you provide the answers to a few questions?

What operating system do you uses on your computer?
How are you uploading files to your server at he the moment e.g. cPanel, FTP program (which one?)?
Have you seen the installation instructions amongst the files you have downloaded? See below:

INSTALlATION:

To install and use, unzip this file into your Moodle root directory making sure
that you 'use folder names'. This will create the following files:

/blocks/side_bar/lang/en/block_side_bar.php
/blocks/side_bar/block_side_bar.php
/blocks/side_bar/block_side_bar-README.txt
/blocks/side_bar/config_global.html
/blocks/side_bar/config_instance.html

Visit your admin section to complete installation of the block.
In reply to Ray Lawrence

Re: Side Bar Block

by Myrrh Lynn -
Windows 98SE 2nd ed. & yes, I have seen the installation instruction on all of the things I have downloaded. However, when I download any modules/blocks, etc. at present, a save box opens in my C:/ directory, not on the server. I can't figure out how to save anything from the internet to the server. Everything goes straight into my C:/ on my computer.

So, at the moment, I can't figure out how to upload files to the server. This is where I'm stumped. The webhost provided this handsome little domain manager that also has a file manager on it. From there I downloaded Moodle as part of an Elephante pkg the host offered to the server. I have a File manage for the Moodle that allows me to upload 5 FILES at a time from my own computer. I don't see any instructions or options to access downloads from the internet.

In this domain manager control panel I do see 1 FTP "in use". I can't find anything called cPanel. So I am assuming I am using an FTP.

Does this look like a problem with my downloading method?
In reply to Myrrh Lynn

Re: Side Bar Block

by Myrrh Lynn -
I just received a reply from the support from my webhost and they said I wouldn't be able to install anything on my own if it required access to a 'root' directory. Only the serve administrators have access to the root directories.
Does this sound right to you? This is my first website, so I am cluless.
In reply to Myrrh Lynn

Re: Side Bar Block

by Ray Lawrence -
Strictly speaking yes. But "installing" a block in a Moodle should be OK.

It would be best to get the latest version of the side bar block from CVS. However, to make things simpler if you message me your email address I'll send you a zip file with these included.

You will need to upload this to your server to the "moodle" directory (folder). Nest you'll need to unzip / extract the contents of the zip file. You should see an option for this somehwhere in your domain admin file manager interface.

If you can't find where moodle is on your server, your webhost will be able to tell you.

When the file has been extracted you should see this:


/blocks/side_bar/lang/en/block_side_bar.php
/blocks/side_bar/block_side_bar.php
/blocks/side_bar/block_side_bar-README.txt
/blocks/side_bar/config_global.html
/blocks/side_bar/config_instance.html

Log in as admin on your site and you should see the update messages. You'll then be able to add this block to your courses.
In reply to Myrrh Lynn

Re: Side Bar Block

by Myrrh Lynn -
I just fixed it - all by my little self!big grin
YEAH!!!
There were too many folders. I moved the folder side_bar straight into the blocks folder and deleted the preceeding folders. They were redundant since I don't have access the the 'root directory' per my webhost. It has installed.
In reply to Ray Lawrence

Re: Side Bar Block

by Paul Nijbakker -
Hi Ray,

How does one vote. I do not see any vote option on the page.

Rgrds,
Paul.
In reply to Paul Nijbakker

Re: Side Bar Block

by A. T. Wyatt -
Greetings, Paul--

You have to log in first. Did you ever make an account for the issue tracker? I don't think it pass es through from moodle.org.

atw

In reply to A. T. Wyatt

Re: Side Bar Block

by Ray Lawrence -
Aha! I didn't think of that. IIRC the tracker account log in details are the same as the main site.
In reply to Justin Filip

Re: Side Bar Block - can add only 1 side bar in 1.9.2?

by Sarah Ashley -
Hello Justin, and distinguished fellow Moodlers,

We installed the Side Bar block on our 1.8.2 Moodle where it worked perfectly until we upgraded to 1.9.2.

Now, you can only add 1 side bar block to a course. If you add more than one, Moodle seems to treat them as one and the same. When you add links to Side Bar #2, they show up in Side Bar #1. And Side Bar #2 does not have jump menus for adding resources and activities. Side Bar #2 has a simple drop-down menu with a GO button for both Add a Resource and Add an Activity options. Weird!

And if you delete one of the Side Bars, all of them disappear!

What's up with the Houdini act????? angry (See attached image)

Is there a newer version for 1.9 some place, or in the works maybe? Is there a method for upgrading with the Side Bar block?

Any light that can be shed on the subject would be most appreciated.
A million thanks!

Sarah Ashley
Attachment SideBarMystery.png
In reply to Sarah Ashley

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: Side Bar Block - can add only 1 side bar in 1.9.2?

by dan attwood -
Just click on the edit button at the top of the block and you'll see text field that will let you change the block title
In reply to dan attwood

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Justin Filip

Re: Side Bar Block

by Guy Thomas -
Picture of Core developers Picture of Plugin developers

WARNING - adding this as a sticky block can delete the site main menu, forums and resources from your front page!

If you add this as a sticky block and then delete it it can really make a mess of your moodle.

Its because a sticky block that is being configured has a page id of 1.
I've added some code to the blocks instance_delete function to fix this:

function instance_delete() {
global $CFG;

if (empty($this->instance)) {
return true;
}

// GT Mod - Do not try to delete a sticky block's resources when viewed on sticky block config page
if (isset($this->instance->pinned) && $this->instance->pinned==true){
if (intval($this->instance->pageid)==1){
return true;
}
}

I've also attached the fixed version.


In reply to Guy Thomas

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: Side Bar Block

by Guy Thomas -
Picture of Core developers Picture of Plugin developers
Hi Monia.

The resources are stored in your Moodle data directory under the course you are viewing.

E.g.

/home/moodle/moodledata/1

Regards

Guy
In reply to Guy Thomas

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: Side Bar Block

by Guy Thomas -
Picture of Core developers Picture of Plugin developers
Its not easy I'm afraid (at least it wasn't for me).

Providing your site course has an id of 1, to get all your forums back just for the front page you can run the following sql SELECT statements on a backup version (you do have a backup, right?):


==========================================
forum table:

SELECT * FROM mdl_forum WHERE course=1

forum discussions table

SELECT fd.* FROM mdl_forum f LEFT JOIN mdl_forum_discussions fd ON f.id=fd.forum WHERE f.course=1

forum discussion table

SELECT fp.* FROM mdl_forum f LEFT JOIN mdl_forum_discussions fd ON f.id=fd.forum
LEFT JOIN mdl_forum_posts fp ON fd.id=fp.discussion WHERE f.course=1
==========================================

If you are using phpmyadmin you can export the results and then reimport them to your "damaged" moodle.

Also, note- any file attachments to forum posts will also need to be restored from a backup of your moodle data directory.

I couldn't restore the main menu - I just ended up recreating it.

Hope this helps.

Guy


In reply to Guy Thomas

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Guy Thomas

Re: Side Bar Block

by Frank Erazo -
Guy:

Thanks for the update.

One question - how can I make the block available for use on My Moodle?

When I go to the Sticky Blocks to configure it, the Side Bar is not available in the drop down menu for the blocks.

Thanks!
In reply to Frank Erazo

Re: Side Bar Block

by Guy Thomas -
Picture of Core developers Picture of Plugin developers
I recommend you DO NOT use it as a sticky block!
The fix that I have added is just to stop it from destroying your moodle front page (forums, main menu, etc) when you delete it.

Have you clicked "notifications" under the administration menu after installing it?

Guy
In reply to Guy Thomas

Re: Side Bar Block

by Frank Erazo -
Of course.

Unfortunately, I have not had the experience where it destroyed the Front Page.

I have actually customized our Moodle. We use the My Moodle, but with a slight twist.

1) We use accordion style menu for the categories.
2) I've removed the ability (hacked of course) to prevent users from adding and removing their own blocks.

In reply to Justin Filip

Re: Side Bar Block

by John Anderson -
Not sure if this is the best place for a side bar block question but here goes. I was hoping to use the side bar block on the front page. But if you hide it, like you would normally in a course, it does not work the same.

When hidden on the front page, the resources and activities are not accessible; just the way a normal block works. Is this because visitors are not logged in like a student? Any other ideas?

I am using Moodle 1.9.x and the latest download of the block.

Thanks
In reply to Justin Filip

Re: Side Bar Block

by Muhammad Omer Saleem -

Hi to all,

I am using moodle 2.0.3+. i need that "sidebar" block for moodle 2.0.3+. Please help me to find out this block because i want to show separate activities and resources in a course that do not have to appear in course sections.

Thanks in advance,

Omer

In reply to Muhammad Omer Saleem

Re: Side Bar Block

by Penny Mondani -

Hi Omer,

I use Side Bar all the time, too, which is one reason why I'm not upgrading my 1.9 site yet.  Side Bar was not available for 2.0 last time I asked.  It was originally contributed by Mike Churchwood (a Moodle Partner).  I asked him about it last summer and he wasn't sure if they would be upgrading it.  You could contact him again.

Alternatively, you could contact a Moodle contributor, Davo Smith.  I have talked to him about upgrading Side Bar for 2.0 so he might be able to do it for you.  His website is: http://davodev.co.uk/ where you can find contact information.

The Side Bar makes it possible to add CMS functionality to any Moodle course, which for my business clients, is a very important feature.  Good luck and let me know what you find out!  Penny

In reply to Penny Mondani

Re: Side Bar Block

by Ger Tielemans -
Side Bar block is sick, do not use it: why? When you try to delete a sidebar block, the children of that block stay in the database, if you did not remove them first (and you get no warning!) they are not removed too.

This is a work-around that always works (and also goes in the backup)

ONE: exception the course format SCORM, you must patch that one to make it possible there too:

THE WORKAROUND:
1. make your course one section bigger then you need: 20? >> 21
2. put all your sidebar activities and resources in that section
3. create a html block and link to these resources and activities
(add also an img in the link to imitate the sidebar-block-look)
4. when you are finished, do not hide the extra section, but lower the number of sections.

The only function you will loose is the open/close the eye in the sidebar

I hope that someday someone creates a good sidebar block for 2.0, I like the concept.
In reply to Ger Tielemans

Re: Side Bar Block

by Penny Mondani -

I, too, hope that "someone" creates sidebar for 2.0, because I LOVE it.  I use it in all of the 1.9 sites/courses that I build.   The workaround that you describe is one that many recommend, but it is an extra step and not as easy for non-tricky people to update.  

In 2.0, the main menu block can be made "sticky" (which is accomplished by making it appear on every page, from within the block settings), but it is not the same block across courses...the content in that block is the same as in topic 0, so as is, that isn't much help.  But it does work somewhat like Ger's workaround with the last topic.  It would be nice if the main menu block in a course would either carry over the same content as the front page version OR be updatable the way the front page main menu and sidebar are.

In reply to Penny Mondani

Re: Side Bar Block

by Hélène Bouley -

I've just had a look on Davo web site - the side bar block doesn't seem to be the same as the one in 1.9. We use a lot the side bar too : is some body else writing some block to present ressources and activities on Moodle 2?

In reply to Hélène Bouley

Re: Side Bar Block

by John Ryan -

I use the side_bar block extensively in my moodle site.

Updated 2 weeks ago to moodle 2.0.7 from 1.9.16 and all went well.  Using the Moodle 2 version of side bar and it has worked great -until tonight.

It has now disappeared -well the contents of the blocks have disappeared, the empty blocks are there.

There are "orphaned sections" at the end of the course sections -ut not for all the blocks.

Any odeas how to fix (and prevent repeating) gratefully received.

Thanks

John

In reply to Justin Filip

Re: Side Bar Block

by Fernando Oliveira -
Picture of Plugin developers

I realize this thread is quite old, but if you used the sidebar block and are currently experiencing problems backing up or restoring courses in Moodle 2.x, you may want to see my post here

thx,

Fernando

In reply to Fernando Oliveira

Re: Side Bar Block

by Alexandre Texeira Bondelas -

I'm desperate updated my moodle to version 2.4 and SlideBar not work. I need urgent help. May I add the block, but I can not add resources on it, is like assuming no link, and displays only the text.

 Error

Tnks.

 

 

In reply to Alexandre Texeira Bondelas

Re: Side Bar Block

by Alexandre Texeira Bondelas -

Hi,


The solution to this is create the activity in one of the centrals block and turn on edition mode and move the activity to the sidebar block. Using this mode works ok.
I'm happy!!

My regards

In reply to Alexandre Texeira Bondelas

Re: Side Bar Block

by Wen Hao Chuang -

I tried this with Moodle 2.7.x but it still didn't work? Can someone please confirm that Side Bar Block simply does not work for Moodle 2.7.x? Thanks!

In reply to Wen Hao Chuang

Re: Side Bar Block

by Hartmut Scherer -

Hi Wen,

Perhaps 2-3 weeks ago I got an error message while trying to install the block Side Bar. 

After your comment I tried it again. This time I successfully installed Side Bar (version 2.7.1; downloaded from HERE) in Moodle 2.7+ (Build: 20140703). I have no explanation why I couldn't install it previously, but was able to install it today. I can only encourage you to try it again.

With kind regards,

Hartmut

In reply to Hartmut Scherer

Re: Side Bar Block

by Wen Hao Chuang -

Hi Hartmut, thanks for your reply.

I was able to get it installed, but when I click on "+Add an activity or resource" in the Side Bar block, it simply does not do anything. I also tried to drag and drop activities that were already created in the center Topic X area to the Side Bar, it didn't work either. I'm testing this on the latest version of FireFox (v 31.0). Thanks!

In reply to Wen Hao Chuang

Re: Side Bar Block

by Hartmut Scherer -

Hi Wen,

I uninstalled the Side Bar block after I got a blank page with an error message yesterday. Sorry, but I will not be able to give more details or do more testing with this block. Instead I am going to use the HTML block with links to the last section. 

With kind regards,

Hartmut