Moodle plugins directory: Static Pages | Moodle.org
Static Pages
We have seen Moodle installations where there was a need for displaying static information like an imprint, a faq or a contact page and this information couldn't be added everything to the frontpage. As Moodle doesn't have a "page" concept, admins started to create courses, place their information within these courses, open guest access to the course and link to this course from HTML blocks or the custom menu.
We thought that this course overhead doesn't make sense, so we created this plugin. It is designed to deliver static HTML documents, enriched with Moodle layout and navigation as a standard Moodle page which exist outside any course. Static pages will be available on catchy URLs like http://www.yourmoodle.com/static/faq.html and can be linked from Moodle HTML blocks, from your Moodle theme footer and so on.
Using this plugin, you can create information pages within moodle, but without misusing a whole course just for showing a textbox. It is not meant as a fully featured content management solution, especially as you have to work with raw HTML, but it is quite handy for experienced admins for creating some few static pages within Moodle.
Please see README file for details about the usage and features of this plugin.
No support in the comments section on this page
Please note that we don't provide any support for this plugin in the comments section on this page.
We appreciate your commendation and reviews for this plugin in the comments. For bug reports and support requests, please read the extensive information in the plugin's README file first and create, if needed, a ticket in the bug tracker which is linked below.
Thanks for your cooperation.
I have some solutions that I hope other users of this plugin will find useful.
Regarding the apache rewrite issue. I discovered that I needed to remove the leading slash before static/ in the RewriteRule. So I now have this:
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^static/(.*)\.html$ /local/staticpage/view.php?page=$1&%{QUERY_STRING} [L]
You can also use:
RewriteRule ^(.*)static/(.*)\.html$ $1/local/staticpage/view.php?page=$2 [L]
Now the clean urls work.
Also, I wanted to add images to my static pages. I put images in /moodledata/staticpage/images. When I put the relative path or the absolute path to the image in the static page html, the image can't be found. I think because this is in moodledata. So I moved my staticpage folder to the Moode http root and reconfigured the plugin to use that location. However when the page is rendered for the clean url the path to the image is getting caught by the RewriteRule. So I created a neighboring folder /staticpage_images and put my graphics there. Then in my static page html my img code is:
If your handy with html I think you can get pretty dynamic with adding static content to Moodle.
Darrel
I don't have a single clue where to post a new question, I'll drop it here I guess.
We have installed the newest versions of Xaamp and Moodle on a Windows XP pro machine to set up everything locally before we upload to a server. We get as far as setting up the admin stuff, then go to supposed localhost login page to Moodle, but it does not load, just get the page not found error message. The control panel for Xaamp is open with appropriate services running. Even if we try to manually open a Moodle PHP page from the Moodle folder in the Xaamp/htdocs/Moodle directory , nothing happens. Localhosts file is not blocking anything. No firewall is running. Same results in 3 browsers
Anybody have any ideas on this?
We are lost
after reading your problem explanation I am pretty sure that your "page not found" error has nothing to do with our local_staticpage plugin. Your problem seems to be much earlier in the installation process of Moodle.
Please ask your question in "Installation help" forum on https://moodle.org/mod/forum/view.php?id=28.
Thanks for you work on this useful plugin. Can I make one suggestion that you include the following in the view.php file after setting the global $page:
//hack to hide static pages from guests
if ($CFG->forcelogin) {
require_login();
}
This will mean that if the site has "force users to login" set then the static pages will be behind the login, rather than accessible to anyone.
Thanks
Toby
thanks for your suggestion, it's included in the 2.6 version of the plugin which was just published.
Alex
the plugin issue this message:
"The Document Should Be available at the Following URL, but actually in the browser will not be Able to download and view it (Perhaps there is something wrong with your webserver configuration - see the README file for details):"
also with the option "Force Apache mod_rewrite"
thanks
Carlo
well, there have been discussions here in the comments section about similar problems before. I admit that this plugin may not work always out of the box, but we have always got it running sooner or later.
Please tell me more about your installation. Does the webserver process have the rights to read the static page files? Which URL is marked with the error message you have cited - the www.yourmoodle.com/local/static_pages/view.php?... URL or the www.yourmoodle.com/static/.... URL? Did you put any rewrite rules into your webserver configuration?
Alex
My moodle is located in a subdirectory: www.mysite.com/moodle
and the folder "moodledata" is out of moodle: www.mysite.com/moodledata
I do not know how to check if the webserver has permission to read the static pages.
All URL are both marked as an error!
thanks
Charles.
the link: www .mysite.com / mooodle / static ... call the 404 page not found page of the main site
(which is in wordpress)
while the link www .mysite.com/ moodle/local/staticpage /view.php?page=index
gives an internal server error
if both URLs are marked with an error message and if www.mysite.com/moodle/local/staticpage /view.php?page=index gives you an internal server error, there is something fundamentally going wrong.
- You need to check if your webserver is able to read the static page files in your moodledata directory. I don't know your webserver (Apache, nginx, IIS...), so I can't give you a bulletproof hint how to check this. Please talk to your webserver administrator.
- You need to check your webserver logs. If there is an internal server error, there might be a error message in the logs which will give us a hint what's the problem.
Alex
AH01215: suexec policy violation: see suexec log for more details, referer http://www.mysite.com/moodle/admin/settings.php
and
End of script output before headers: view.php, referer http://www.mysite.com/moodle/admin/settings.php
thanks
Carlo
I am not familiar with the suEXEC Apache extension. But a little Google research about your error message told me that your webserver might have insufficient rights to access the plugin files on /local/staticpage or the staticpage files in your moodledata root: http://www.pranavpc.com/2010/12/solution-for-suexec-policy-violation-error-that-occurs-in-some-webhosts/.
Please have a deeper look at this and talk to your webserver admin if necessary as this problem is beyond the scope of my plugin.
Alex
the problem was in the permissions, I did reset the permissions from my webserver administrator and now the plugin works perfectly.
thanks for your support and for your patience
Carlo.
that's great, glad I could help.
Alex
Plug-in works for 2.7 as well, Please update records for compatibility with 2.7 so people wont hesitate downloading.