Basically, the Category Tree Nav block allows you to add a category/sub-category/course menu structure to your Moodle setup. The block will display a separate menu side block for every category at the level you are at. For example, at the site level, the menu will display each top category in a block, with any subcategories for that category listed in the block followed by any courses. The order of the display is dependent on the order you set in the course administration section.
An optional configuration parameter allows you to use the first course in a
category (defined by the order you set) as the category home page. If you set this option, the category name will link to the first course in that category. You can then use that course as a pseudo-category page, much like the site home page. When this option is used, the first course will not appear in the category menu, but will only be linked by the category name.
Have fun with it!
Mike, I am getting an error ...
Block block_category_tree: /www/x/x/x/htdocs/blocks/block_category_tree/block_block_category_tree.php was not readable
There's an extra block_ in the path. Where would that come from?
I'm going to check this out Mike.
Marc--the folder that you put under blocks should be named: category_tree rather than block_category_tree (oops Mike?). Then, the db folder and the two files: block_category_tree.php and block_category_tree.html will be in that folder.
I don't think you installed it properly. I just realized that my README file was written for a zip file and not for getting it from CVS. I've attached a zip file here you can use instead. Just unzip it into your Moodle root.
I think you may have taken the entire contrib directory and put it in your '/blocks' directory. If this is the case, remove the directory 'block_category_tree' from your '/blocks' directory.
To get it from CVS, you'll need to put it somewhere first (I use a '/contrib' directory in my Moodle root). Then, you copy the '/contrib/block_category_tree/blocks/category_tree' directory to your '/blocks' directory. You will also need to copy the '/contrib/block_category_tree/lang/en/block_category_tree.php' file to your language directory.
(or just use the zip file attached)
I get this error:
Notice: Undefined variable: moddata in /home/training/public_html/courses/blocks/category_tree/block_category_tree.php on line 154 -- for a category with no courses in it.
I'll have to look at this (and think about it) some more, I do like the idea of having a "course" homepage for each category--that way you can design a page with all of the information you want. However, I don't like that if you choose this option, the block heading (which is the category) turns into a link--because then it is not consistent with the other blocks (unless you have your block headings and links both set at the same color, etc.)
You can visit the block's config page and save the configuration variable and the warnings will stop. Its more interesting with this variable set anyway.
Or, I have updated the code and included it here.
I tried installing the Block from the zip.
Nothing happens when the same has done.
Any suggestions where I am going wrong.
Download zip and install as stated.
Get no update message on Admin screen
We were thinking of doing something similar but with some peculiar things:
The idea is to be able to create "home pages" for groups of courses. But the point is that you should have the right to access to the home page if you are enroled to any of the courses inside it.
There's a point that I don´t like about the way it works your block now: if you have the first course as category home page you are still able to see it as a course if you navigate through the pre-existent course block and category list. It should be associated to the category always, independently of from where you access to it.
And it could be nice to be able to configure it by category: in one indicate that a course is its home page and in others say that there is no home page for this category.
And maybe, it would be a point to make users always go through the category home (if it exists) before entering the course.
What do you think about these things?
That's what this does, without the automatic enrolment. But, you could install the metacourse hack, and set up your category course as a metacourse. That would do exactly what you want here. The metacourse will be standard in 1.5.
I wanted to do this without having to make any changes to the core code of Moodle, or the database. On my site, I don't add any of the other navigation blocks so there's no way to get to the course any other way (short of typing them in the address bar). I also reworked the nav scheme (breadcrumbs) in my theme's header so that the categories get displayed as part of the nav structure with appropriate links.
I considered that as well, but to make it simpler I went for all or nothing. Some of my category homes are quite boring. I'm going to think about this because this is an issue - especially with subcategories.
Not sure I see the point of this.
I'll take a look to the metacourse hack as it sounds really nice!.
We are working on this feature so maybe we change some things but I'll keep you informed. If you change the category home configuration to make it by category, please, post it here!.
Have you updated your category_tree block for 1.5+? I just tried it and it did not create the data tables.
I still can't find the 1.5 version. I installed the zip file that was several posts ago and apparently it didn't like my Moodle as after I installed it, nothing had changes so I deleted the files I installed and now my Main Menu is missing in editing off mode, and when editing is on, it's just the header and footer of the menu box with the normal eye, red x, etc. there are no functions listed on it anymore.
your block description sounds great. I copied the folders today from cvs to the appropriate destinations.
Do you have any idea why your block does not show up in my local Moodle installations. I tried three different ones and with all I don't see the "Category Tree Nav" in the sideblock popup in the courses neither in the blocks list on the admin pages I installed another block as a check without any problems.
I use Xampp on win 2000 and Moodle 1.5.2 + (2005060222)
Thanks for any tips
Make sure you are using the 1.5 version. I think, if its not, it'll show up at the bottom of the blocks admin page as an invalid block.
ups, it seems I tried an old one. But it does not show as an invalid block, it does not show up at all.
I used the only block my CVS downloaded contrib folder from the repository has shown. Your 1.5 version shows up in the web interface and is marked "In the Attic". The doc tells that it is omitted for download then. Did you delete the folder or mark it somehow invisible? Can you please look what you can do, I would like to try your block.
It has something to do with a CVS remove command removing the files to the "attic" folder. I think the original files may have been added to MOODLE_15_STABLE rather than to head, so when you check out the files, you need to specify the specific tag. This is my very primitive and probably imperfect understanding of the phenomenon.
At http://www.star.bnl.gov/STAR/sds_l/ssd_l/cvs_tutorial.html I found the following:
"CVS remove does not actually remove the files from the repository. It only removes them from the "current list" and puts the files in the CVS Attic. When another person checks out the module in the future they will not get the files that were removed. But if you ask for older versions that had the file before it was removed, the file will be checked out of the Attic."
So the workaround is if you check out the files with a previous tag version, you can get the files:
cvs -z3 -d:pserver:email@example.com:/cvsroot/moodle co -r MOODLE_15_STABLE contrib/block_category_tree_1.5
At least this worked for me!
Hope this helps,
I work with the windows CVS program. I checked out the whole contrib folder with the tag
MOODLE_15_STABLE and guess what I got? I ended up with 2 folders
block_marking_1.5. All the other folders have been deleted. Ok I guessed that this would happen. To have all contrib folders on my harddisk I added a second folder for the standard contrib.
Why are some 1.5 modules taged as
MOODLE_15_STABLE and others not? That is way too confusing. Can please anybody make a proposal how to handle all modules in contrib the same. On the other way separating all 1.5 modules from older ones is a very good approach which would help a lot when consequently used for all modules usable in 1.5.
My 2 cents
Actually, it would be a good idea to reorganize contrib completely. Maybe have it something like:
I don't know enough about CVS to know if this can be applied to the existing structure or not.
I am stuck. Can you help me out???
I am trying the CVS route to download.
This is what happens.
In C:\MOODLE CVS: "C:\Program Files\TortoiseCVS\cvs.exe" "-q" "login"
CVSROOT=:pserver:firstname.lastname@example.org:/cvsroot/moodle co -r MOODLE_15_STABLE contrib/block_category_tree_1.5
Logging in to :pserver:email@example.com:2401:/cvsroot/moodle co -r MOODLE_15_STABLE contrib/block_category_tree_1.5
Fatal error, aborting.
cvs.exe [login aborted]: bhupinder: no such user
Error, CVS operation failed
CAN you guide me how th resolve to complete the download from the CVS/ Correct the CVS loging method.
I have an account on CVS and would likew to use CVS only for downloads.
Try replacing bhupinder with anonymous:
CVSROOT=:pserver:anonymous@ .sourceforge.net:/cvsroot/moodle co -r MOODLE_15_STABLE contrib/block_category_tree_1.5
The above command is for anonymous CVS, which is what you need if you just want to download, not commit to CVS.
Hope this helps,
Thanks for you Help.
I tried on the lines suggested but i have the following ERROR returned:
In : "C:\Program Files\TortoiseCVS\cvs.exe" "-q" "login"
CVSROOT=:pserver:firstname.lastname@example.org:/cvsroot/moodle co -r MOODLE_15_STABLE
Logging in to :pserver:email@example.com:2401:/cvsroot/moodle co -r MOODLE_15_STABLE
cvs.exe [login aborted]: authorization failed: server cvs.sourceforge.net rejected access to /cvsroot/moodle co -r MOODLE_15_STABLE for user anonymous
Error, CVS operation failed
I'm using tortoise cvs for windows to access the cvs and I'm having difficulties to find the block_category_tree_1.5. Can anyone help me? Thanks
I'm using the tree navigation block & I like it a lot, however on my setup it has a quirk that is driving me crazy.
I use the category as the course name, and the courses within a category are the offerings from previous quarters, with the current offering at the top.
I have the setting "Use first course in category as category page" turned on, so that when the course name is clicked, the current offering comes up, with previous offerings (minus the current one) listed in the side bar - simple, intiuitive & elegant ...
However ... at seemingly random intervals, clicking on the category opens the LAST course listed under the category, while the side bar still omits the current offering!!
Then, after another seemingly random interval, it reverts back to correct behavior, and opens the top listing again.
I have been unable to correlate this behavior with any other factor.
You can visit one of my courses at
I've downloaded the zip and install as stated.
However I get no update message on Admin screen
nor are there any new blocks appearing.
Can Anyone help???