As some of you might remember I did start a thread earlier this year about CMS like features. The reason why I put this hack in distribution is that I don't have much time to work on it, so I hope that some one has some extra time in their back pockets and continues with it. I really would like to see it using Jon's pagelib at some point. It would be very nice to be able to add blocks also inside the pages as well.
You can download needed packages from here: http://julmajanne.com/stuff/cms.zip and http://julmajanne.com/stuff/blocks_cmsnavi.zip
-- Cut 'n' paste from readme.txt --
Ok! With this "plugin" you can create page content to your Moodle's
frontpage, and have multiple menus, so that's why CMS like ...
CAUTION!!! USE AT YOUR OWN RISK.
Installation:
Installation is not completely automatic, so you'll have to
fork your Moodle a little bit. Not much.
So lets start with that manual stuff:
1. You have to add new CONSTANT in your /course/lib.php file:
define("FRONTPAGENEWS", 0);
define("FRONTPAGECOURSELIST", 1);
define("FRONTPAGECATEGORYNAMES", 2);
define("FRONTPAGETOPICONLY", 3);
define("FRONTPAGECMS", 4); <-- this one.
2. You have to add that value also in /admin/site.html (aprox. in line 33-37).
$options = array(FRONTPAGENEWS => get_string("frontpagenews"),
FRONTPAGECOURSELIST => get_string("frontpagecourselist"),
FRONTPAGECATEGORYNAMES => get_string("frontpagecategorynames"),
FRONTPAGETOPICONLY => get_string("frontpagetopiconly"),
FRONTPAGECMS => get_string("frontpagecms","cms")); <-- here
3. You have to make changes to your index.php (same place where your config.php is):
At the start of the page (somewhere around line 49)
if (empty($CFG->langmenu)) {
$langmenu = '';
} else {
.... code stuff here ....
}
$pid = optional_param('pid', 0, PARAM_INT); <-- add this one
and then find the last "case" clause at the bottom of the page and add a new one:
case FRONTPAGETOPICONLY: // Do nothing!!
break;
// frontpage cms hack
case FRONTPAGECMS:
include_once($CFG->dirroot .'/cms/cmslib.php');
if ($editing) {
cms_print_page ($pid, $editing);
} else {
cms_print_page($pid);
}
break;
4. Now unpack cms.zip under your $CFG->dirroot (means same level for example blocks and message directories are).
5. Point your browser to http://<yoursystem>/cms/
(something like http://www.domain.tld/cms or http://www.domain.tld/moodle/cms/)
This installs all necessary database tables for you.
6. Unpack block_cmsnavi.zip under your $CFG->dirroot and visit your administration page so that the
cmsnavigation block gets installed correctly.
7. Go back to the cms directory and first add new menu then you can start create pages.
- menu names in cms admin are only for internal usage. You can add whole different name
to menus at cmsnavigation block config.
8. Go to your main page and turn editing on and add "site navigation" block to your frontpage.
9. You should be done if I didn't forget anything out of this
Hopefully you get it work without biggish fuss...
Cheers,
Janne Mikkonen
Edit: forget to mention it's for 1.5 and up ...