Blocks on all Pages after log in

Blocks on all Pages after log in

by John Kilbride -
Number of replies: 2

HI,

How can i set modules such as resources and forums to display, with blocks on either side just as the course homepages do? Is it a mater of editing the resource/view.php and forum/view.php to look more like the course/view.php . Has anyone tried editing these files?

Thanks

John

Average of ratings: -
In reply to John Kilbride

Re: Blocks on all Pages after log in

by Rob Clarke -
Hello,
from what I have seen of the code it is not as simple as that. The main problem is that the IDs of the blocks to display for a specific course are stored in the database and to me it appears that one cannot associate blocks to a non-course page in the same way.
You could store the IDs of the blocks that you want inside the relevant view.php pages and then call the functions that are used in the course/view.php (or the main moodle index.php) but then you can only change the blocks for a specific page by changing its source code.

Another thing to consider is that you would also need to bring the html code over from the course/view.php function and modify it because some of the pages do not have the three column table layout (left blocks, center content, right blocks).

I would like to achieve the same thing but I would also like blocks for the teacher pages and I am wondering whether I will need to create a new module with its own database table to store information about the blocks, especially as the existing blocklib.php block methods tend to require a course id and some of them write directly to the database. The problem is that a teacher doesn't have a course id so I cannot use all of those methods and I would need to create my own.

I hope this has been of some help.

-Rob