General plugins (Local): Local Pages

local_pages
Maintained by Picture of Kevin DibbleKevin Dibble, Picture of Learning WorksLearning Works
This plugin is to enable Custom pages and forms in Moodle. It provides a quick way to create custom contact forms and custom page content. The pages created can be publicly accessed or available to certain users based on settings you choose for the page. This allows you to create pages such as: "terms and conditions", marketing material and more.
189 sites
465 downloads
16 fans
Current versions available: 2
Purpose:

This plugin is to enable custom pages and forms in Moodle.

The Pages Plugin provides a quick way to create custom forms and custom page content.

By default, all pages created can be publicly accessed.

To control page access, to logged in users or users with certain capabilities, this is controlled in the page Editor.

Forms:

Local Pages support forms that can send email and will keep a viewable history of all emails sent.

Menus:

Pages supports a tree structure and will display in the Navigation menu if "Show in menu" is checked.

Page Urls:

If your server supports .htaccess files - you can enable clean urls instead of page id numbers. 

This is ideal if you wish to use any pages with Google for tracking user engagement.

Installation:

Install the plugin into your local Moodle under /Local/pages/

Adding and managing pages:

In Moodle under Site Administration -> plugins -> local plugins->pages will be the links to add new pages and edit the plugin settings.

Screenshots

Screenshot #0

Contributors

Picture of Kevin Dibble
Kevin Dibble (Lead maintainer)
Picture of Learning Works
Learning Works: Developer
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Andreas Giesen
    Mon, Mar 18, 2019, 11:27 PM
    I changed your rewrite-code from:
    RewriteEngine On
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . index.php [L]
    to
    RewriteEngine On
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /local/pages/index.php [L]
    now it works smile
  • Picture of Andreas Giesen
    Mon, Mar 18, 2019, 11:36 PM
    Now I still wonder what to put into the "Capability required" field. Is it a role name? Will it be restricted to that single role, or will higher level roles be included? If it is a single role, can I add several roles, divided by (?) etc. The PDF manual has nothing on that....
  • Picture of Kevin Dibble
    Tue, Mar 19, 2019, 4:40 AM
    Hi Andreas,

    Good to see that your .htaccess file now works.
    Your server may have 'RewriteBase /' in its setup - meaning rewrites were going to the main index.php instead of the pages index.php file.
    I'll make an issue to update the pages .htaccess to have a RewriteBase directive to be RewriteBase /local/pages/ for servers that have a higher level rewrite command.

    Capability:
    The capability field is to get the users capability. The help icon for that field states what it does... its a standard Moodle form help box, so apologies, but we're not sure why help boxes are not showing for you (They are standard moodle help boxes, icons that have displayed no issue here)

    Enter in the capability string, you can comma separate to add multiple capabilities
    If you want everyone BUT that capability to view - put an '!' mark before it
    Example: mod/folder:managefiles,!mod/quiz:grade

    mod/folder:managefiles = Everyone with this capability can view.
    !mod/quiz:grade = Everyone with this capability cannot view.

    eg - To stop those not logged in or guests, use a capability for the "authenticated user" that the "guest" user does not have. This will stop Google from indexing pages (As Google gets the "guest user" when indexing the site).

    The capabilities accepted can be viewed here: https://docs.moodle.org/36/en/Category:Capabilities

    cheers
  • Picture of Andreas Giesen
    Tue, Mar 19, 2019, 5:19 AM
    The icons show, but all over the site the actual help does not appear (in Chrome / Win). I already deactivated all Chrome extensions, but still... But that is my issue...

    Thanks for explaining the capabilities setting. But would it not be much more straightforward to do this with roles? This seems overly complicated.
  • Picture of Kevin Dibble
    Tue, Mar 19, 2019, 5:35 AM
    Hi Andreas,

    Ah - the dreaded "Inherited site" issues.

    Some Reasons are:
    One:
    The original server person may have placed an apache directive AllowOverride None
    AllowOverride None

    This will stop .htaccess files in directories being read by apache.
    The smart URL setting will only work on a server that supports .htaccess files in a directory.

    Two:
    There is a field called 'Page url' - it's this field that the smart urls use.
    What the "Enable smart urls" does is when the page menu is being output - it puts in the 'page URL' value as the link instead of the ID.
    Pages can still be accessed via the ID of the page.

  • Picture of Dinis Medeiros
    Thu, Apr 4, 2019, 7:03 AM
    "The icons show, but all over the site the actual help does not appear (Chrome /Edge / Firefox)". I have the same issue.
  • Picture of Kevin Dibble
    Thu, Apr 4, 2019, 7:11 AM
    Hi Dinis,
    This can be due to a javascript error occurring on the site - you will need to open the inspector to see what is causing it. It can be caused by the boost theme related to this (as yet) unfixed issue: https://tracker.moodle.org/browse/MDL-57037?attachmentOrder=desc

    The solution would be to try a different theme (Clean) and see if they work. If you are having issues, try getting the latest copy of Moodle (if possible), or raise this bug again with the Moodle team.

    Cheers,
  • Picture of Dinis Medeiros
    Sun, Apr 7, 2019, 11:13 PM
    I have this issue ONLY in this plugin! I have the last moodle version installed. Have you seen this? https://github.com/learningworks/moodle-local_pages/issues/23
    Thanks again.
  • Picture of Kevin Dibble
    Mon, Apr 8, 2019, 5:55 AM
    Hi Dinis,

    Thanks for the feedback.
    We have updated to add these areas into the language strings. (Purge caches once you have installed this latest version) to get the new strings.
    And yes, the plugin does support Moodle 3.6 - So I have updated the supported versions.

    Cheers,
  • Picture of Dustin Brisebois
    Fri, Apr 26, 2019, 12:29 AM
    Great plugin,

    Receiving this error:

    Exception - Call to undefined method MoodleQuickForm::hideIf()

    Debug info:
    Error code: generalexceptionmessage

    Stack trace:
    line 165 of /local/pages/forms/edit.php: Error thrown
    line 194 of /lib/formslib.php: call to pages_edit_product_form->definition()
    line 57 of /local/pages/forms/edit.php: call to moodleform->__construct()
    line 410 of /local/pages/renderer.php: call to pages_edit_product_form->__construct()
    line 56 of /local/pages/edit.php: call to local_pages_renderer->save_page()

  • Picture of NAMAN ARORA
    Fri, Apr 26, 2019, 1:03 PM
    Thank you. Great work
  • Picture of Vanshika Garg
    Fri, Apr 26, 2019, 2:13 PM
    Amazing post. Thanks for sharing. Ludhiana escorts
  • Picture of Reza Rahull
    Wed, May 1, 2019, 4:16 AM
    This is a nice plugin....thank you.
    Check NTPC admit card
  • Picture of David Demetrashvili
    Mon, Jun 3, 2019, 8:45 PM
    Hello, I want to set view only for Authorized users, I don't want to show my pages content to everyone.
    How can I make this?
    Thank u.
  • Picture of Kevin Dibble
    Tue, Jun 4, 2019, 8:53 AM
    To make pages visible to authorized (logged in users) - use a capability that only logged in users have - you can use this as a starting point:
    moodle/user:editownprofile
    Place this into the page edit text area called "Capability required".
    Now only users that have rights to edit their profile can then view the page.

    This will prevent logged out users and guests from having access. (As capabilities can be customized - I highly recommend to check its impact by using another browser to see if logged out users and guests can view the page (Logged out users will be taken straight to the login page, Guest users will see a message "You do not have rights to view this page").

    Warning:
    Don't use legacy capabilities - Moodle will not like that and the page will not show - just a warning message instead.
    So avoid "moodle/legacy/xxx"

    Tip 1:
    You can do the reverse permissions - say logged in users are not to see - add an exclamation mark before the capability to become "!moodle/user:editownprofile"

    Tip 2:
    Multiple permissions can be used - let's say you only want logged in users and NOT Managers to view the page (as an example):
    moodle/user:editownprofile, !moodle/user:editprofile (Place a comma between the different capabilities to create your own view filter)

    Tip 3:
    Capabilities to use can be viewed at:https://docs.moodle.org/37/en/index.php?title=Category:Capabilities - there are lots to choose from.
    You can give roles in Moodle a certain capability and enter that same capability here to restrict pages access to just that role.
    e.g.: moodle/badges:createbadge
    Give that capability to a role that can create badges - then create a page for instructions and images that you want to use for badges.
    That way only uses that can create badges can access the page.

    cheers
1 2 3
Please login to post comments