Static Pages icon

Static Pages

Moodle plugin which displays static information pages which exist outside any course, imprint or faq pages for example, complete with Moodle navigation and theme
Price option: Free

Supports Moodle 2.4-5.2 See all versions
Latest release: 2 weeks ago
Installations: 4885
Downloads (last 90 days): 1472

Frankenstyle name: local_staticpage
Local plugins

Comments

Comments are no longer open for new posts. Existing comments remain available to read.

Alex,
Thanks for the quick reply. When I do as you suggest I now get a nicely formatted moodle themed page saying 'page not found'. This is even more maddening now because I can see that the formatting part of the plugin works nicely but its not finding the page. The page of course is there: path moodledata/staticpage
I have full rights via EasyAppache on my hosted server, but did not find anything related to mod_rewrite that I can enable. where should i look next.
Thanks as always
Oscar
Oscar,
could you please disable "Force Apache mod_rewrite" in the Plugin's settings and check if your FAQ page is available on the static page's normal URL (/local/staticpage/view.php?page=pagename)?
If yes, there's a problem with your rewrite rules in your webserver.
If no, there's a general problem with the plugin which we'll have to check.
Alex
Alex,
First, thank you for developing the plugin. This functionally is needed by lots of us moodle users.
Just installed and configed the newest version of the plugin, strictly following the README including the mod_rewrite code. Getting the "Not Found" error on my FAQ page, and within the plugin getting the error below:
"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):"
What am I missing? Thanks in advance. moodledata is under the root folder, not in the public_html
Oscar
Dear local_staticpage Users,
sorry for the big delay since my last post. Finally, I had the possibility to look at local_staticpage again.
If you are running Moodle in a subdirectory, I think you should simply use the following Rewrite rule:
RewriteRule ^/yoursubdirectory/static/(.*)\.html$ /yoursubdirectory/local/staticpage/view.php?page=$1&%{QUERY_STRING} [L]
If you want a general rule, no matter what the subdirectory is named, you could try
RewriteRule ^(.*)/static/(.*)\.html$ $1/local/staticpage/view.php?page=$2&%{QUERY_STRING} [L]
Please note that there is a new plugin version in the Moodle plugins repository with the following features which have been requested by you here in the comments:
- Add an option to set the data source of document title, document heading and breadcrumb item title
- Check availability of static page directly on settings page, show error if page isn't downloadable
Alex
I've been playing around with this and found that the following worked for the rewrite rule:
RewriteRule ^static/(.*)?.html$ /local/staticpage/view.php?page=$1&%{QUERY_STRING} [L]
Is this correct? It seems to work on a 'rewrite tester' that I had a go on to develop this rule. The one provided in the readme file for this plugin did not seem to work.
Dear Pranoy,
the update only contains the extra character support (see Release notes on https://moodle.org/plugins/pluginversion.php?id=3558 for details) and a minimum Moodle Version of 2.5.1.
I'm sorry that the other things you requested are still not finished - it's no big deal implementing, but I'm too busy at the moment.
Hello Alexander,
Does the new update involves only the extra character support ?
as I have already done that.. do I have to update to this ?
Well, if I open http://www.pharmaglimps.com/local/staticpage/view.php?page=package, a nicely styled static page is showing. Did you get it working in the meantime or are there still problems?
Hi , please help me I insttalled your plugin and add some .html pages in moodledata/staticpage directory but I'm not able to see them, if i open those pages in browser they are opened but with plugin its not showing, I also changed theme/essential/config.php file and add the code and follow all the instructions in readme file even normal_link also not working please help
This is the link :-
http://www.pharmaglimps.com/local/staticpage/view.php?page=package and link of scrrenshot is :- http://imgur.com/Fyb3asn
please help thanks
Dear all,
new version for Moodle 2.5 is out with a fix for - and _ characters in filenames.
All other things (improved mod_rewrite support, support for title tags) are not forgotten and will be there in a few days.
Alex
Title tag suits the best for the title of page.. as normally title tag only serves as the page title..But selecting setting will be good... for now I have changed the view file accordingly to work with the title tag..
Now just waiting for the mod_rewrite fix.. smile
Thanx
Dear Pranoy,
please have a look at the plugin's README file:
"local_staticpage will use the first h1 tag as heading, title and breadcrumb of the resulting Moodle page.
If there is no h1 tag, the heading, title and breadcrumb of the resulting Moodle page will be set to the pagename derived from the document filename."
When I coded local_staticpage some time ago, using the first h1 was a good solution for me. As many more others start using this plugin, I think it does not fit everyone's need.
Would it be ok if a add a plugin setting to the next release which lets you decide if you want to use the first h1 tag or the title tag as page title?
Alex
Hello Alexander,
Is there a way to make the page title to be something else from the file name itself ?
For Ex: if want a page termsandconditions or terms_and_conditions.html the same name comes as the title of the page which doesn't look good!
Please look into this also..
Justin,
thank you very much for this comment. You are completely right, I will change the parameter type for the next version of the plugin (which will be released for Moodle 2.5 in a few days). In the meantime, you can change the parameter type by yourself as you described to support hyphens and underscores in staticpage URLs. I will also add a hint in the README which characters are allowed for staticpage URLs.
Sorry that I wasn't aware of the SEO topic, I only intended staticpage to use for simple URLs like "impress.html" or "contact.html".
FYI: There is another problem with the plugin when Moodle is installed in a subdirectory. Staticpages work with the "normal URLs" (/local/staticpage/view.php..., but not with the Rewrite rule. I will try to adress this in the next version, too.
Alex
Dear Moodlers,
To anyone who has a "Page Not Found" Error, please note that in the file view.php the code:
// Get requested page's name
$page = required_param('page', PARAM_ALPHA);
Must be changed to $page = required_param('page', PARAM_ALPHAEXT);
If your filename has either underscores or hyphens within them, i.e: My-Heavyrank-Page.html
From the Moodle docs:
* PARAM_ALPHAEXT the same contents as PARAM_ALPHA plus the chars in quotes: "_-" allowed
So Alex seeing as how this is for SEO purposes and those kind of URLS get the most SEO bang for the buck, it would probably be safe to presume that PARAM_ALPHAEXT would be preferable to use as it is makes your SEO plug-in even more SEO friendly.
-Justin Brylski