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 ...
Could you please explain how this is different than your NetPublish module. Could you use the two together?
Thx
Chardelle
First of all the Netpublish is a module and it's only affective in courses and it is intending to be a activity module (a online magazine).
And this is a tool which can be used only to change Moodle's frontpage view. It actually allows you to have "a site" within your frontpage.
The ideas of these two are quite similar but the purpose differs much.
(Quite vague explanation, little like political statement. Lot of words, no content ).
- Janne -
Thanks Janne
Hopefully it'll get much better in the future
- Janne -
Wow so cool. Works great. A couple of very little things:
1. you need to add $strdatabasesuccess = get_string("databasesuccess"); to cms/index.php.
2. and maybe... add a final step to your instructions to be sure to set the site settings to CMS content. Like a dork I forgot to do this, then wondered why it didn't work when I clicked on a link.
You really are helping to turn Moodle into a real powerhouse of a program!!!
I was reading the string. Can you advise where and why this string is top be added.
$strdatabasesuccess = get_string("databasesuccess");
What is the functionality and the advantage.
Sorry if it sound dumb. I am new to moodle and CMS.
Thanks
Bhupinder
Require login feature added to menus, meaning you can define does that menu show when user is not logged in.
If you already have installed older version: Just unpack this new one over older one (it'll replace both cms and cmsnavigation). Log in as admin and visit your http://<yoursite>/cms/ and it'll update your cms installation.
Trying it first time: Read readme.txt inside the zip file.
I'm adding html pages to my new 1.5 site right now!
I just updated and got this error when updating the block:
Unknown column 'cn.requirelogin' in 'field list'
SELECT n.pageid, n.title, n.isfp, p.publish, cn.requirelogin FROM mdl_cmsnavi_data AS n, mdl_cmspages AS p, mdl_cmsnavi AS cn WHERE n.pageid = p.id AND p.publish = 1 AND n.naviid=1 AND cn.id = 1
And this error for the CMS
Table 'training_mdle1.mdl_cms' doesn't exist
SELECT value FROM mdl_cms WHERE name = 'version'
But everything seems to work. Also, you have all of the block folders in this zip?
Also, the pageupdate icon brings up the A required parameter (sesskey) was missing error-- even though the sesskey is there?
The query part is expected, since there is whole new table in database and queries changed a little bit.
All of block folders? Should be only cmsnavigation (blocks/cmsnavigation).
the pageupdate icon brings up the A required parameter (sesskey) was missing error-- even though the sesskey is there? Crickey, have to fix that one
I just love this feature!
I just wanted to let you know of some odd behavior with pageupdate.php. and the html editor (ironic isn't it?). If I go back to make changes, the html editor does not "keep" any of the html, for example changes to text styles and inserted images disappear and have to added again. I also noticed that in Firefox, I can paste into the editor, so something is definitely different about the way it behaves here.
And a question. If I publish a page it appears in the menu as a link. Then, if I want to add further pages from that page, I can add a page and not publish it, then just add the link to that page to the "first" page. The only problem I have with this is that when I click to the non-published page, the highlight on the link in the menu goes away--which you would expect really, since you aren't on that page anymore. Is there a way to get that highlight to stay? Or, is there a better way to have second level pages?
Thanks
What version of Moodle in 1.5 branch you're using?
At one point there were a $value = clean_text($value); call in print_textarea (weblib.php) function call that stripped most of images and html attributes from the text.
Answer: No, there isn't a way to keep "so called" upper page link highlighted , but some point there will be unlimited subpages feature included. When it's done, I can't say. I'm very tied up with "logi - tutoring tool".
- Janne -
There's nothing much in this update execpt:
- Support for unlimited subpages (for each page of course).
If you had installed CMS before, just unzip the new version over the old one
and make couple of minor changes in your $CFG->wwwroot/index.php file.
first, change line:
$pid = !empty($_GET['pid']) ? clean_param($_GET['pid'], PARAM_INT) : 0;
to:
$pid = optional_param('pid', '', PARAM_RAW);
And change the case clause to this:
case FRONTPAGECMS:
include_once($CFG->dirroot .'/cms/cmslib.php');
if (! empty($pid) ) {
$pages = explode(",", $pid);
foreach ($pages as $key => $value) {
$pages[$key] = clean_param($value, PARAM_INT);
}
$pid = (int) end($pages);
} else {
$pid = 0;
}
if ($editing) {
cms_print_page($pid, $editing);
} else {
cms_print_page($pid);
}
break;
If you're doing a new installation, read "readme.txt" file inside the cms -directory.
- Janne -
This will be cool, but, I'm stuck. First, I don't have a line in my index.php that looks like this: $pid = !empty($_GET['pid']) ? clean_param($_GET['pid'], PARAM_INT) : 0;
just the one you added previously:
$pid = optional_param('pid', 0, PARAM_INT);
Which I changed to what you posted above, and also tried switching the two I see the new options dropdown to add, edit, delete, but I don't see any way to make a page a subpage.
Help.
The line you've changed is correct (it depends on what version is used).
To make a subpage: Check (checkbox) one of the existing pages and choose from dropdown menu addnew. And if you wish to add new page at the toplevel, don't check any existing pages.
- Janne -
I highly recommend this, its an absolutely fantastic way to add content/info to your front page. Thanks Janne
I can't embed a swf file into a page. The html editor in update.php strips the object tags if I tried to embed flash. Is there an easy fix for this?
E.g. code:
<object width="151" height="68" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<param value="http://trainingandcoachingcenter.com/file.php/1/lw2.swf" name="movie" />
<param value="high" name="quality" />
<embed width="151" height="68" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" src="http://trainingandcoachingcenter.com/file.php/1/lw2.swf" />
</object>
Gets stripped to:
<param name="movie" value="http://trainingandcoachingcenter.com/file.php/1/lw2.swf" />
<param name="quality" value="high" />
Thanks
The object and embed tags are "prohibited" in version 1.5.x(2, can't remember in which subversion it came affective) and there is a new variable in settings called "allowobjectembed". This is set to false by default and you should enable it to prevent <embed> and <object> tags to be stripped.
- Janne -
Thanks Janne, you're the best.
I think I said I wasn't going to bother you anymore, but...
I'm having some strange behavior that I believe may be caused by the latest CMS code since it started when I upgraded. Whenever I turn on or off editing in a course, it also turns editing on/off for the front page and vice versa. Any ideas?
A few tests gave the following results:
- logged in as a regular teacher: whenever I turn editing on (or off) in one of my courses, it is automatically switched to the same status in all my other courses;
- when logging in as administrator, this includes the front page.
Regards,
Leo
Janne
This block is brilliant and i love it. Its a necessary block for everyone and it should be made a part of the standrard moodle.
Just a few suggestions :
1. When a page is clicked upon, there should be a way of changing the font colour on the left to highlight it. Presently, the font only becomes bold
2. If we could get a way of changing the background colour or add a picture in the "Menu Name" option, the complete looks of a moodle installtion could be changed..it would be brilliant !
Suggestions taken in to consideration . I'll try to squeeze the first one into next update. Second one I'm not so sure, because it's not up to cmsnavigation block but the whole block system...
- Janne -
and choose from dropdown menu addnew...
Janne, did you upload the right version? I see nowhere this option in the menu (or the code)
- Janne -
I am keen to see what this addition can do an have just added cms to my 1.52 version. All goes well until I try to add a new page and I get the following error message
Parse error: syntax error, unexpected ';' in C:\apachefriends\xampp\htdocs\moodle\cms\html\pagesindex.php on line 14
which refers to this line
<?php echo /* cms_print_addnewpage($menuid); */ ?>
removing the semicolon makes no difference.
Also when the tables were installed there was an error message about a missing sesskey. Any ideas?
kathy
I also got the missing sesskey during the table installtion but it seems to work fine despite that error. To see what this block can do, click here.
I got that unexpected ';' error but due to change in site.html page. If you see the readme.txt which is part of the cms.zip file, point no 2 says for the files site.html:
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
While it askes you to add that last line, you must be careful to remove the ';' from the line above. Best is to replace the entire part in the readme.txt file to the site.html file, the error gets corrected.
You can just remove that whole line from the file.
I didn't get missing sesskey, but I'll check into it. I'll try to get new updated version out at sunday (finnish) evening.
- Janne -
Janne
Before you release a new updated version, just a few small suggestions :
1. This discusion post has become too long and complicated, lets start a new one introducing your brilliant new block and post it both in the "Developer Forum" and the forum for "Blocks"
2. Your readme.txt files needs to be updated with a few more details. If you have the time to do it, great otherwise I can help with that by trying out your new updated version and sending a revised readme.txt to you.
Please mention in your new post what changes are there in the new version.
Good luck !
One more thing, the session key error does come up...i've tried it on three installation of 1.5.2. Another strange thing : One advantage of the site navigation block is you can add many of them and add lots of pages under each block. However, suppose i add 10 pages to the first block, then try to add a second block, its fine. The moment i try to add a third block, instead of this new block being blank, the entire list of the first block's pages comes into this one.
kathy
I have attempted completeting all the steps for CMS installation.
After completing the actions I did not get the block of CMS under Blocks.
I can on pointing to the http://localhost/moodle/cms
reach the CMS administration page which shows the menu and page creation text.
When I try to go to the settings I am getting an error message.
Parse error: parse error, unexpected '<', expecting T_STRING or T_VARIABLE or '{' or '$' in c:\program files\easyphp1-7\www\moodle\admin\site.html on line 144
I shall greatly appreciate your help as I am stuck and unable to correct the mistakes if any made by me.
Thanks In Advance
Garry
Look up the following lines around line 36 ...
FRONTPAGETOPICONLY => get_string("frontpagetopiconly"),
FRONTPAGECMS => get_string("frontpagecms","cms"));
Do they look like this? Make sure there is only one close parenthesis and no semicolon on the first of these two lines.
There should be two parentheses and a semicolon on the last of these two lines.
Thanks for the reply.
The code is reproduced :
get_string("frontpagenews"), FRONTPAGECOURSELIST => get_string("frontpagecourselist"), FRONTPAGECATEGORYNAMES => get_string("frontpagecategorynames"), FRONTPAGETOPICONLY => get_string("frontpagetopiconly"), FRONTPAGECMS => get_string ("frontpagecms","cms"));
The second parenthesis was missing .
Even after adding the same the error is not going.
Any further guidance???
Garry
A clarification required.
I am trying to install CMS and have an error coming on going through the readme text file i find that the code to be added is
$pid = optional_param('pid', '', PARAM_RAW);
Where as in the directions above
$pid = optional_param('pid', '', PARAM_INT);
Can you advise what is to be done.
Thanks for the help.
PS I am unable to get the block of CMS in the front page.
Any suggestions to resolve this shall be welcome.
Thanks
Garry
is the right line. The directions above is very old .
Have you added menus and pages into them? You need atleast one menu to be able to add cmsnavigation block.
- Janne -
Hi Janne,
The installation is working and it looks great. A very good addon which should I believe add a lot to Moodle.
There were a number of patches uploaded up by you .
I used your latest version of CMS.
Does this take care of the functionality cms_navi, outpublish and netpublish zips too.
If it does not then can you advise what these are meant for and how they can be add to moodle.
If they need to be added can you provide some instructions.
Great Functionality congrats once again.
Garry
- Janne -
Hi Janne,
Thanks for your help and clarification.
Can you be kind enough to advise how to install netpublish and outpublish. If the information is alrady available can you guide me to the source.
This will be I am sure as great as your CMS Block.
I can hardly wait to install both.
Tahanks and waiting you help.
Garry
If you'd like to use Outpublish (which is a plugin for netpublish, allowing to publish netpublishes to outside of Moodle) you unzip that package at the same directory level where you can find directories: admin, lib, theme, etc.
But I strongly recommend that you should start just with Netpublish module and add Outpublish later on, if you choose to continue using netpublish.
- Janne -
All the content here is done using the CMS module.
Also the homepage of http://playpen.monte.nsw.edu.au also uses this module
Sorry for the bother again.
I have placed OUTPUBLISH folders as suggested.
I have not been able to get any confirmation / sign to its availability.
Sorry to sound dumb. But your instructions shall be helpful as to how to invoke feature of this module.
Garry
The list of published publications outside of moodle should be seen at http://yoursite/moodleinstalldir/netpublish.
- Janne -
Hi Janne,
A small problem that requires your guidance.
Placing OUTPUBLISH FOLDER I get the following ERROR.
Warning: file(c:\program files\easyphp1-7\www\moodle/blocks/outpublish/block_outpublish.php): failed to open stream: No such file or directory in c:\program files\easyphp1-7\www\moodle\lib\blocklib.php on line 21
Any Advise.
Garry
You've unpacked the outpublish (the directory inside of this zip file is "netpublish") plugin into wrong folder. It should not be under /blocks -folder, but in same level as blocks -folder.
In your case this means c:\program files\easyphp1-7\www\moodle\netpublish
Outpublish is not a block or a module. It's a plugin for netpublish module.
I hope this helps.
- Janne -
Hi Janne,
It was an error on my part.
The outpublish now works well. A great feature.
Thanks once again.
Garry
If the cmsnavigation block is your problem. You don't have to uninstall or remove cms tables from database.
Did you do both istallations from same cms package? Did you verify that cmsnavigation (site navigation) block did not install from admin -> blocks page?
- Janne -
I did use the same CMS package. The cms block is not listed in the block administration menu. It is also not listed as an option when I try to add a block. I can however administer the CMS menus and pages. I don't recall seeing the normal block installation process. Is there a way to force it to reinstall the block?
Is the cmsnavigation directory in your block directory (/blocks/cmsnavigation)? If it isn't unzip cmsnavigation folder (and related pages) from cms.zip package into block directory and visit admin -> blocks again.
- Janne -
Try logging off and logging in again and that to through the admin side and see if the problem gets solved.
I've tested this with 1.6dev and it works fine for me !
It caused me some problems with this great modification in that I got a fatal error message if I attempted to open the first page in editing mode.
I just posted my fix here:
I hope this helps other users of both mods.
Anyway Thank you!
Why will it not display what I put into it?
Jeff
Josep M.
You also published the individual pages?
Jeff
Did you do fresh install or did you update older version?
- Janne -
No links in blocks.
Turn editing on -> (on cmsnavigation blocks' title)
Choose menu and name it and save changes.
- Janne -
Jeff
I published the pages, set one as default... and so on, did a fresh install and had setup a menu before I published any pages.
I don't think this information is relevant, but just in case. I'm doing this on a PC where Moodle is installed over XAMPP.
Josep M.
$menus = get_records("cmsnavi", "course", $courseid);
print_r($this->config); // <-- this one here
Turn editing mode on and visit block's config page and you should see something like this: stdClass Object ( [menu] => 1 [title] => Navigation ) printed on block's config page.
If you both (Jeff and Joseph) see something like above, I'll scratch my head for a while...
- Janne -
stdClass Object ( [menu] => 1 [title] => Navigation )
Jeff
So update to latest version http://julmajanne.com/stuff/downloads.php
- Janne -
ps. You need to visit cms admin page once to make this fix to apply.
Is there an easy way to reinstall the new version? I mean, if it is only one line of code that has changed in one particular file (in my case mysql.sql), can you tell us where we copy the modified file (in case this is what has to be done). I prefer doing that than undergoing the whole process of installation again.
I see that there are a gazilion mysql.sql files. I imagine that the one I have to replace is the one in ...\moodle\cms\db but I wanted to double check. Am I very far from the mark?
Josep M.
- Janne -
Also, sorry about my ignorant question, but what is the function of the menus? I've created some menus, but I don't see them appearing anywhere.
Josep M.
Edit the block instance to contain one of the menus you've created (click image in blocks' title bar).
Choose menu from dropdown list that you wish to use in this block and save changes.
- Janne -
Now the question I have is how to make that all the pages become visible appearing one after the other. The way I have it now, each page is made visible once you click on the menu, but once you click another item in the menue the page disappears to be replaced by the next. I seem to have seen sites using your CMS where the pages created via CMS appear consecutively on the main site page.
Josep M.
Just tried to upgrade from one version to another and am now getting this error on the homepage
"Warning: Missing argument 2 for cms_print_page() in /home/authlowc/public_html/lms/cms/cmslib.php on line 142"
It also says "No contenet yet!!"
Funny thing is, turn edit mode on and then I can see the content on the homepage.
Before you ask:
- Yes I have been to the admin screen to upgrade
- I downloaded it today. Te old one was about4 weeks old.
- I can still edit/manage pages inthe admin side.
Any ideas??
Did you make proper changes to your index.php file as discribed in readme.txt?
- Janne -
Worked a charm. One of these days I will actually read a readme file
I had assumed the extra moodle code had not changed and that only your CMS. And you not what they say about assumptions
Any chance of adding a preview button at some point. Especially with the HTMLeditor not being true WYSIWYG (ie not showing my header styles), a preview function would help immensly.
I'm using the first version of CMS on our production site www.dpsfaridabad.org
The home page content comes from CMS. I would also like to add an activity like news forum on the center column of the home page, just below the default CMS page...however the default page from CMS always remains where it is and activities get added only above it, not below.
Any way to change that ?
Janne,
A preview would be a great addition to an already great module!
Also, to get the CMS to show in a courses is there a different set of instructions than on the front page? I can't seem to get the pages to show. It always goes back to the course topics page.
Thanks,
Robbie
why do you get two brackets?
Site Navigation tables have been set up correctly
any ideas..
It also apears in the Add Block as two brackets
Thanks
any ideas?
$string['Site Navigation'] = 'CMS navigation';
I have created Menus and Pages and set it as Default and also published it...
I have turned on the block and named it, but it does not display any of the menus..
Any ideas why this not working?
Don't know if this is the problem as I had a similar one. On the actual block click the edit icon (one that looks like a person holding a pen) and you must put a name in the Menu name box. I didn't have this and when I did and did a page refresh all the pages appeared.
Hope this helps.
Silly me found out why it was not working... Had not changed my Site Settings to show CMS content...
Woops
Is there anyway to have Site News and CMS Content?
You could add "News items" block on your front page...
Thanks for that....
Is there anyway to remove the date from the frontpage?
I did have a look at the coding but i could not find where it was getting the date from then again my PHP is not that good...
Hello,
i read about your CMS extension for moodle.
You have done fine work! The CMS is easy to use and has a good installation file.
I have translated the cms.php file (placed in the lang/de directory) to german (-> de). Perhaps you'll add it to your cms.zip archiv for other german users.
I have one suggestion, is it possible for you to implement a page structure with pages and subpages in a future Version of your CMS?
Thanks for your work
Greetings from germany
I've added your german translation into distribution package.
Could you specify what you mean with "page structure"?
At the moment you can create subpages for every page ( so the level hierarchy is somewhat unlimited, although it's not documented very well (at all to be precise). You just have to choose the parent page first, then select "Add new page".).
- Janne -
To get rid of the date-- in html/frontpage.php comment out lines 53 and 54 like this:
// print '<p> </p>' . "\n";
// print '<p style="font-size: x-small;">('. $modified .')</p>';
This addin is very useful and an excellent addition to Moodle...
Hello Janne,
thanks for the tip "to choose the parent page and select Add new page".
The problem is solved
I think a little Help Icon with a tip like these will be helpful for user.
Eventually you can add these icons in a future Version of cms?
I can translate the new help text files to german if you want.
Christoph
I installed CMS addon in my unicode enable moodle site.
When I added menu in CMS with farsi (utf-8) name system inform that the menu created but menu was not created and I should create menu with english name and then edit it with farsi language.
This should be fixed now (among other things I found while cruising through the code). Just download the latest version.
- Janne -
But the answer is within a course: easier and within the frontpage: harder
But it's on me todo list now
This forum has a long thread and I really do not have the time to read thru them. I hope I am posting this message in the right place.
Firstly, I am aware there is this AJAX technology which allows a portion of a web page to refresh without doing so for the rest of the page. It would be good if any cms module in moodle can take advantage of such technology.
Secondly, in order for a cms module to work, the navigation, i.e. the menu system, must be sophiscated enough to provide customisation and eyecandies for the reader.
Just my 2 cents worth.
regards.
Error: Your not allowed to view content of this page! - Guest Login
i am happily using your CMS. It works fine. But if a guest is going on my Site he can't see the CMS Navigation Block and the CMS text I have crated on my moodle Homepage.
Instead the text "Your not allowed to view content of this page!". If I login as admin or a normal user (teacher or learner) the CMS text ist showed correctly.
Is there an option where I can activate CMS text?
Thanks a lot
Christoph
Re: Error: Your not allowed to view content of this page! - Guest Login
So you should not request login for site frontpage, meaning the menu that contains default page of the site ( at cms manage menus, edit menu and uncheck "require login" checkbox).
- Janne -
edit: Let's add new choice where you can choose to allow or disallow guests to view such pages.
I installed cms addon but it didn't work as expected. I did a fresh insall on Moodle 1.5.3, with latest cms.zip, then did as it's said in readme.txt the result is
- when Edit mode is on, i see an empty cmsnav block with a text link "admin", the administration of menus works fine.
- when Edit mode is off no sign of cmsnav block
- in block setting page, is there a settings link for cmsnavigation?, cuz i don't have one.
- default page is working fine.
BTW, i tried the
print_r($this->config); // <-- this one here
modification, but it didn't give anything, i'm suspectiong that navblock is not working fine.
TIA
JVA
I believe that cms_rc01.zip is the last release, am i right?
First i i used cms.zip, then cms_rc01.zip, now i can see empty navblocks.
The thing is that i don't what the front page to be CMS content, i want the nav links and the cms pages, but not the front page, i want to put the news on the front page. Is there a wayto put the news on the cms Front page?
You can see it here at FSEO.org.
BTW, i'd like to help in the evelopement of this module, are you using any kind of version management system so i can get a dev. version and patch my changes or what?
"i don't what the front page to be CMS content, i want..." Moodle 1.6 has this option ( actually both of them are seen), but 1.5 do not have it, so you'll have to hack /blocks/cmsnavigation/block_cmsnavigation.php file.
Just comment out lines:
if ( $CFG->frontpage != FRONTPAGECMS ) {
return $this->content;
}
to
//if ( $CFG->frontpage != FRONTPAGECMS ) {
// return $this->content;
//}
At this moment you'll have to use plain "diff" to make patches (also available for windows at gnuwin32.sourceforge.net ).
I forgot that you have to change also your index.php file to:
$pid = optional_param('pid', '', PARAM_RAW);
if ( !empty($pid) && $CFG->frontpage != FRONTPAGECMS ) {
$CFG->frontpage = FRONTPAGECMS;
}
This way you'll actually see the page content when following links.
I am sorry to bother you. I have the same problem of yours. I down load the lasted verson of moodle, than the lastest cms. I follow exactly the guide of readme.txt. The only step I am wondering is copy lang file to .../lang/en directory. I am not sure whether I am supposed to copy every file of lang en of the cms folder to..lang/en of the moodle, the same with fi and de. When I logged in as admin page for installation of cms data, then I went to the front page of the moodle. I sar nothing. I could not see the front page of moodle. Everything has gone. I tried some alternatives but I got the same result. Could you please help me or give me any suggestion. my email phuongphamsu@yahoo.com or @gmail.com
Thank a lot
phuong
My site sitting "http://www.thegioitre.com/admin/site.php" disapperar. I do not see any thing, could you please suggest me how can I fix that. In addtion, I am not able to see the site navigation bar , please give an advice.
Thank you so much,
Regards
Phuong
- Janne -
- Janne -
Thank you so much for your help. I am able to figure out how to do it now. thank for your great module
Regards
Phuong
All seems to be working when logged in as Admin with editting turned on.
When editting is turned off I'm getting the 'No content yet!!' message.
Also the subpages aren't displayed when clicked on in the menu.
Any ideas?
Thanks and regards,
John
- Janne -
I try CMS in course mode (CMS format instead of weeks) under a testversion of 1.6
Everything seems to work with exception of:
- I can add blocks in edit mode but they become invisible in view mode
- I can add titles to the blocks
- I cannot edit menu entries to the blocks
(I took it from a working 1.5.3 version)
// return $this->content;
//}
I'm having a similar problem, I can see and edit the menu and if I click on a menu link I see the page, but in the front page I get "No content yet". I had set as default different pages and it says, "default page changed..." but I still get "No content yet" at frontpage. As I would like to have pages before login acess, can you , and anyone who have an idea, help me to solve this?
thank's in advance,
Daniel
thanks for your enthusiam in developing such a cms-tool.
Having done the installation procedure als indicated in your readme.txt on a 1.5.x (editing files and copying the directories) system I have to face the problem of not being able to login into moodle as admin or any other user. As I try to login I do not see any error messages or something like that.
I googled a bit to find some hints to solve the problem. I made use of those hints indicating to reset admin password and to check the MySQL table entries. All the entries are as suggested but I still cannot login.
Do you have any idea why this happened ? Are there any files which "block" the login procedure ?!
Thanks in advance for any quick hints.
Chris
Having installed the mysql tables via directory http://domain.tld/cms/ I receive the following error messages:
Warning: file(/home/www/web345/html/moodle/blocks/loancalc/block_loancalc.php): failed to open stream: No such file or directory in /home/www/web345/html/moodle/lib/blocklib.php on line 21
Warning: file(/home/www/web345/html/moodle/blocks/shared_files/block_shared_files.php): failed to open stream: No such file or directory in /home/www/web345/html/moodle/lib/blocklib.php on line 21
Any idea ?
Chris
Solution 1. Copy blocks loancalc and shared_files again into blocks directory.
Solustion 2. Goto your admin >> blocks and delete loancalc and shared_files from your database.
- Janne -
Please hepl me! I have some problems when installation cms:
I receive the following error messages:
Error: Database connection failed.
It is possible that the database is overloaded or otherwise not running properly.
The site administrator should also check that the database details have been correctly specified in config.php
Since the CMS addon doesn't initialize anykind of database connection ( this is done by Moodle it self ), you really should check that your database is running properly.
What database you use ( mysql or postgresql )?
- Janne -
The following error is now appearing above the cms content (yes the content still displays)
Second parameter of cms_print_page has changed from integer to object!
To get rid of this message make appropriate changes to your index.php file!
What is it I am meant to change in the index.php?
in your index.php file change cms_print_page function's second parameter $SITE->id to $SITE ( there are two lines ). This change came along with section support within cms pages ( the whole object is needed for that ).
- Janne -
I have just upload the new version into our site we are running v1.54...
I get this message -
Second parameter of cms_print_page has changed from integer to object!
To get rid of this message make appropriate changes to your index.php file!
What do i Change?
- Janne -
Like described above ( Julian's question )
Sorry I don't understand... I have this at the moment
if ($editing) {
cms_print_page($pid, $SITE, $editing);
} else {
cms_print_page($pid, $SITE);
}
Sorry...
http://moodle.org/mod/forum/discuss.php?d=31835#148702
To show blocks on mod pages. It works great for Admin block and Main Menu, but the CMS block just shows up empty, and I can't add items to it.
Without the theme hack, CMS is functioning normally, any idea why theme code would break the CMS Navigation block but not the others?
Code:
HEADER.HTML (at the Begin of the file)
//Must include the libs of blokcs
require_once($CFG->dirroot .'/lib/blocklib.php');
HEADER.HTML (at the end of the file)
<?php
$CFG->showblock=0;
$inme=me();
//this is the list of files or directories where i want to sho my Blocks
//if you put a directory all the files inside it will show the blocks
$fblocks = array("/calendar/","/mod/","grades.php");
//Here I use a flag to know if I'm in a page or directory of the list
foreach ($fblocks as $fblock){
if(ereg($fblock, me())){
$CFG->showblock=1;
}
}
if($CFG->showblock==1){
//Now I create a table for the main part of the page with two colums, one for the Block
//and other for the really content of the mod
echo "<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" width=\"100%\">";
echo "<tr><td width=\"120\" valign=\"top\">";
//This is the first colum
//I Include my left Blocks
$PAGE = page_create_object(PAGE_COURSE_VIEW, SITEID);
$pageblocks = blocks_setup($PAGE);
if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) {
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
}//This is the second colum for the content of the mod
echo "</td><td valign=\"top\">";
}
?>
<!-- END OF HEADER -->
FOOTER.HTML (at the begin of the file)
<!-- START OF FOOTER -->
<?php
//If I put the Block in this page now I must close the table
if($CFG->showblock==1){
echo "</td></tr></table>";
}
$CFG->showblock=0;
?>
if ( $CFG->frontpage != FRONTPAGECMS && $SITE->id == $courseid ) {
return $this->content;
}
- Janne -
Janne
I just installed a fresh copy of Moodle 1.6 and downloaded the CMS block from the contrib CVS.
It got installed fine, and the default page i set shows up, but when i click on any other page link, the default page only shows up.
I've made all changes as per the readme file, and even tried commenting out
if ( $CFG->frontpage != FRONTPAGECMS && $SITE->id == $courseid ) {
return $this->content;
}
lines in the block_cmsnavigation.php. I changed the index.php file from $site->id to $site - no effect. It doesnt work either on the SITE page or inside the courses
The site under cosntruction is www.selflrn.com . Would appreciate any ideas.
TIA
Anil
$pid = optional_param('pid', '', PARAM_RAW);
in your index.php file.
If that doesn't help, turn on debug mode ( administration >> configuration >> variables in section miscellaneous) and check if you get any sql statement errors.
- Janne -
please, start a new thread this is getting really long.
Notice: Undefined property: frontpageloggedin in /home/bonlth/public_html/moodle/admin/site.php on line 40
Warning: array_flip() [function.array-flip]: The argument should be an array in /home/bonlth/public_html/moodle/admin/site.php on line 40
Warning: array_flip() [function.array-flip]: The argument should be an array in /home/bonlth/public_html/moodle/admin/site.php on line 42
Warning: asort() expects parameter 1 to be array, boolean given in /home/bonlth/public_html/moodle/admin/site.php on line 43
Warning: array_flip() [function.array-flip]: The argument should be an array in /home/bonlth/public_html/moodle/admin/site.php on line 44
Warning: implode() [function.implode]: Bad arguments. in /home/bonlth/public_html/moodle/admin/site.php on line 44
Any idea what I'm doing wrong? When I click on links (as the block does show up), I don't see any content I've made.
Janne,
Is this compatable with version 1.6.2? I don't see a index file available for this version so was wondering what would happen if I used the 1.6.1 index?
Also, just so that I understand everything OK. I can insert or embed an existing web site in Moodle using this plugin, right?
Thanks,
Wayne Campbell
Thanks in advance for any help you can provide. I'm excited to use this plugin and amazed that I was able to get it installed without breaking something
Jason
i am trying to do something about it i will let you know.
I like very much the descriptions I read about this module, that can fill a lot of needs.
I just installed it (files 1.6.1) on my new 1.6.2+ installation at galeinai.net.
I opened a CMS menu in one course without problems. then, I passed to create a page related to that menu. everything looks right, but when I submit I receive all the time the same odd error "title missing", and the page to edit again. and have no field named "title" (btw, I don't know what to input in the "parent..." field).
Therefore, I can't make any page there.
any good idea?
thanx in advance,
daniEl
nevertheless, I realized that the "missing title" is also an issue by itself. I look at the pages I created and I see that really a title is missing.
so, I have 2 problems now:
1. how I bypass the "missing title" error I receive permanently in firefox while adding a new page?
2. how I can get the ability of giving some title visible upon the body of every page?
thanx again,
daniEl
Simon
I do ... with small modification.
..lasse..
Could you please share that with us? I got it set up (I think) but am unable to save a menu, just getting a pretty generic error
salut,
verdon
You can read my solution from: http://moodle.org/mod/forum/discuss.php?d=62456
First read ALL what Janne is written in cms-installation text. Then you have the knowledge and then you see "what" and "where" you must do my modifications.
I've upgradet Moodle to 1.7.1+ and I can say, that solution works in that version.
...Lasse...
Well after discovering Moodle, your module was an absolute gift! I even uninstalled 1.7 and went back to 1.5 so I wouldnt have to do loads of poking around in the PHp code.
Can I just ask, is it possible to set sections so that only a particular user can modify it? I run a school site with about 1000 pages on, most of which I update myself with a couple of very trusted friends doing the rest. I no how easy it is for them to make a small change that wrecks the whole site. Allowing each submenu item to have an "author" would prevent any such calamities.
Another quick question - are you planning on a version for 1.7 and how long will it be?
Thanks again
Phil Waud
First question - no as far as I know!?!
Second question - you're not the only one who has asked me that , and honestly I don't know the answer. I really don't know
- Janne -
Janne
Do you think you could add a "creator" edit only feature? You would need an extra column in the database, and check that the person logged in is allowed to edit the page. I could probably tweak the code myself, but it would then be incompatible with any future upgrades.
I know the pressure your under re. a new version, I just hope you get the time to do it soon!
Thanks
Phil
Hi Janne,
We (here at Bedford School in UK) have been looking at your CMS module with interest, and think it is just what we need to integrate our present intranet with Moodle . . . but we don't have the expertise (nor the nerve!) to do all the necessary tweaks to get it working with the latest version (we need to upgrade to 1.8 for other reasons).
So we just HOPE that you might find time to develop it for V1.8 . . pleeeeease?
thanks,
Bob
I can't make any solid promises at this point, sorry . But I do know that my summer holiday starts at July and I might have some extra time on my hands...
- Janne -
We are in the same situation at Hobart College (Australia, Tasmania http://www.hobart.tased.edu.au) as Bob. I don't have the courage to play with the coding but we would love to integrate our moodle site with our intranet a bit better and your module seems to be the answer. We would be grateful if you can see your way clear to make it less daunting for the uninitiated.
My summer vacation is just one week a way and this is on my todo list, indeed. And I'm going to make it much more easier to install and maintain.
- Janne -
Hello, Janne
I need your help when clic on Publish outside say :
Parse error: syntax error, unexpected ';' in /usr/home/site.com/htdocs/mod/netpublish/outpublish.php on line 37
and exist installed outpublish on root,
any idea ????
Thanks
as a Moodle developer you can access the document in
Ticket ID: YGI-989017
of Moodle.com Helpdesk
in order to read it during your summer vacation.
Hi Janne,
I just wondered how things were going with the improvements to the CMS module. Like other posters, I think that this would be just the thing for integrating our internet and intranet sites. Also, like other posters, I'm not keen on the manual hacking in case I mess something up.
Considering how useful this is, is it being considered as a standard module for 2.0?
Keep up the good work
RW
I am looking forward to the next CMS release.
Many thanks for your active moodle community's support.
I have been looking at thi CMS module with a lot of interest and (for a dummy) managed to install and seem to have operational. I have two points of clarification though:
I seem to be getting an error message above the CMS Block which reads: "Notice: Undefined variable: COURSE in /htdocs/moodle15/blocks/cmsnavigation/block_cmsnavigation.php on line 239"
and..
I cant seem to work how how to display the menu ?
Can anyone assist please:
Hi Janne,
we are actually making a review of CMS side app to check security concerns in our world wide integration (worked with Catalyst).
In my urgent needs I need finish the complete translation for the French Pilot we have to launch in December 2008.
We are disposed to help in code and have some action on it during a while, unless you have some little time to share with us on this enchancements.
First aspect is improving internal navigation, so it becomes easier to switch between the two major editing aspects (menus, and pages). Also fixing the return point when finishing editing, which do not returns always return to edited page.
More deeper, I would like to lower the footprint of the CMS installation on core. One example of this is the capability naming, that were set in the "moodle/cms" scope. Moodle scope should not be used for non core components. Although it works fine, as the correspondancy of capability name and capability code is sufficiant, the localization of the capability names fails because of the get_capability_string() implementation. There is no direct provision for a "cms" subcomponent in core, and this routes the subsequent get_string() call to the 'moodle.php' string file in core, that should be not. In order to properly route capability strings to an "in-module" lang string, wich is much more convenient for install and modularity, capability names could be assigned to the 'blocks/cmsnavigation:' domain. It is consistant as cmsnavigation is the "entry point" of the CMS side app (I call it "side app" because the block is an artefact to access this feature, that runs quasi autonomously from the core Moodle features). The effet of this is that we would have capability names strings to be set in blocks/cmsnavigation/lang/... which is more accessible and has no core footprint.
An alternative would be using a "mod/cms:" scope, but seems routing to a "fake" moodle mod. Call for strings would be routed to a "cms.php" that in that case, can only be the /lang/... (or alternative moodledata/lang/...) locations, as there is no real module entry for this.
Thanks for letting me know about how to handle all those small requirements, if any possibility.
Cheers.
and the capabilities should be named using
'format/cms'
(I'm working on this today and should have a patch later this week that cleans it up a bit)
Dan
I installed moodle about a week ago on my online server, and since then I have been playing around with it trying to get it running for my training outfit. However, I installed the cms plugin, and since I did so, I get a blank page when I click on add/edit courses.
Please what do I do?
After installing this very usefull module on a brand new Moodle 1.9.5 I got a blank page on the home page. This happens because Moodle main index.php has changed and the CMS patched index.php has not.
I compared the two files and changed 3-4 lines in the CMS patched index.php to reflect the changes in the original index.php and now it is working.
If someone gets the same error try the attached index.php to see if it helps.
Cheers
Hi, I have the same problem, I've tried your index.php but it still not work, could you give me some advice? what line need to be change?
Thks!