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 installated this plugin succesfully. And cnfigurated it "Not using mod_rewrite"
/local/staticpage/view.php?page=FAQ
but when I'm trying to enter tha pagr, I'm getting error:
"page not found"
Any suggestions why it happens?
If you look at /admin/settings.php?section=staticpage, your HTML files should be listed there. Is the output of this list ok or are there error messages?
I'm with the following problem:
Your plugin work greatly at the link:
/local/staticpage/view.php?page=quemsou
But at:
/static/quemsou.html - show 404 error.
I tried to activate at .htacess
deny from allAllowOverride NoneNote: this file is broken intentionally, we do not want anybody to undo it in subdirectory!
RewriteEngine On
RewriteRule ^/moodle/(.*)\.html$ /moodle/local/staticpage/view.php?page=$1&%{QUERY_STRING} [L]
And i tried to select the option ( Force Apache mod_rewrite ) at configuration page of your plugin. and it still showing 404 error.
Do you have any ideia, how can i fix this?
PS: Will be great if i be able to chage the structure os url, from: /static/quemsou.html to: /mytextinportuguese/quemsou.html - Bcz im brazillian and all my clients speaks portuguese.
I'm sorry, but I don't understand what you did in your htaccess file. As the plugin is working on the standard URL and you are breaking things intentionally, please talk to your webserver adminstrator how you can make things work.
The rewrite rule simply maps /static/* URLs to the plugin's standard URL. So, you can use any URL part you like instead of "static" and map it to the plugin's standard URL. Again, your webserver administrator should know how to make things work.
Alex
I only have one issue. We use a lot of css on our site, but on the static pages we cannot use any external or internal css! We have to use in-line for everything, and it's extremely frustrating and time-consuming. Is there a way to be able to use internal (we prefer internal) css markups on static pages? If so, could you point me to a detailed method of how to do so?
Thanks!
I'm afraid, the parser which reads the HTML file drops style tags which are placed in the head at the moment.
However, your request is reasonable. I will check if I can allow style tags in the head tag in the next version. This will take some time, please have a look at the release notes of the next version.
Until then, you could place the style tag in the body.
Please note that this is neither valid HTML 4 code nor valid HTML5 code according to my knowledge.
But I think most browsers will render the styles, at least Chrome/Mac and Firefox/Mac do.
Alex
That worked great! Thank you! I never even thought to put the style tag in the body.
I am new with moodle and developing a wesite in moodle 2.7.1. I have installed the local_staticpage plugin. Can you please help me where i need to create the faq.html file, so it can appear in the static page setting page?
honestly, local_staticpage is nothing you should start with when you start learning and working with Moodle. Using this plugin is somehow difficult as all of the comments above will show you. Also, local_staticpage is _no_ tool to make a complete Content Management System out of Moodle.
That being said, if you want to use local_staticpage, please start with reading and following the README file (https://raw.githubusercontent.com/moodleuulm/moodle-local_staticpage/master/README.md). If you have concrete questions, I will try my best to answer them.
Alex
I've been trying to setup 2-3 static pages for my site. The plugin is installed correctly Mod_rewrite is fully enabled, page was created using html. Permissions have been changed.
I get this message in local staticpages>
From the document file's filename, Moodle derived the following pagename:
contact
The document is available and can be linked to at the following URL:
https://mysite.com/academy/local/staticpage/view.php?page=contact
The document should be available to at the following clean URL, but actually a browser won't be able to download and view it (perhaps there is something wrong with your webserver or mod_rewrite configuration - see README file for details):
https://mysite/academy/static/contact.html
My hosting has also looked into the problem, do you have any suggestions?
Thanks,
please look above at the comment from Darrel Tenter from Nov 2013. He posted two slightly different rewrite rules which might work for Moodle installations in subdirs.
Alex
please look above at the comment from Darrel Tenter from Nov 2013. He posted two slightly different rewrite rules which might work for Moodle installations in subdirs.
Alex
Thank you, I have one last question from hosting, is the mod compatible with 2.7 ?
did it work?
Could you please post the working RewriteRule here so I can add it to the README file?
The current module version works with 2.7. The dedicated 2.7 version will be posted within the next days to the Plugin repository.
Alex
did it work?
Could you please post the working RewriteRule here so I can add it to the README file?
The current module version works with 2.7. The dedicated 2.7 version will be posted within the next days to the Plugin repository.
Alex