Static Pages

General plugins (Local) ::: local_staticpage
Maintained by Logo "Moodle an Hochschulen e.V."Moodle an Hochschulen e.V., Alexander Bias
Moodle plugin which displays static information pages which exist outside any course, imprint or faq pages for example, complete with Moodle navigation and theme
Latest release:
4532 sites
3k downloads
215 fans
Current versions available: 22

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.

Screenshots

Screenshot #0

Contributors

Logo "Moodle an Hochschulen e.V."
Moodle an Hochschulen e.V. (Lead maintainer): Maintainer
Alexander Bias: Maintainer
Ulm University: Initial Maintainer
Kathrin Osswald: Former Developer
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • Pranoy Agrawal
    dc., 10 de jul. 2013, 1:03 PM
    I tried using the staticpages local plugin of yours and the normal link i.e the long url for staticpages is working but after using mod_rewrite it's not working anymore..
    I added
    RewriteEngine On
    RewriteRule ^/static/(.*)\.html$ /local/staticpage/view.php?page=$1&%{QUERY_STRING} [L]
    to the .htaccess of the moodle installation directory..
    Please help
  • Alexander Bias
    dc., 10 de jul. 2013, 1:42 PM
    Dear Pranoy,

    you have two possibilities to access a static page:
    1. Via the "normal link", e.g. http://www.yourmoodle.com/local/staticpage/view.php?page=imprint
    2. Via a mod_rewrite link, e.g. http://www.yourmoodle.com/static/imprint.html

    As the normal link is working for you, there should be no fundamental problem with local_staticpage.

    In addition to the normal link, you can establish a mod_rewrite rule as you did. Could you please tell me the URL you are using to call the static page and which doesn't work?

    As soon as you check the checkbox of the "Force Apache mod_rewrite" setting in local_staticpage's settings, the normal link isn't working anymore, only the mod_rewrite links will still work. That's intended behaviour.
  • Justin Brylski
    dj., 18 de jul. 2013, 3:33 AM
    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
  • Alexander Bias
    dj., 18 de jul. 2013, 1:51 PM
    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
  • Pranoy Agrawal
    dg., 21 de jul. 2013, 1:07 AM
    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..
  • Alexander Bias
    dl., 22 de jul. 2013, 2:00 PM
    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
  • Pranoy Agrawal
    dl., 22 de jul. 2013, 9:50 PM
    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
  • Alexander Bias
    dc., 31 de jul. 2013, 4:39 PM
    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
  • vipin goyal
    dv., 2 d’ag. 2013, 11:23 AM
    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
  • Alexander Bias
    dv., 2 d’ag. 2013, 1:41 PM
    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?
  • Pranoy Agrawal
    dg., 4 d’ag. 2013, 3:38 AM
    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 ?
  • Alexander Bias
    dj., 8 d’ag. 2013, 4:15 AM
    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.
  • Martyn Colliver
    dj., 22 d’ag. 2013, 4:38 AM
    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.
  • Alexander Bias
    dl., 2 de set. 2013, 8:02 PM
    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
  • Oscar Elleseff
    dg., 15 de set. 2013, 9:43 PM
    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



Please login to post comments