5

Hey I just started using moodle and the first problem is: how to I add pages e.g. About us , Contact us.

Do I have too add it manually? Where do I have too change any settings? I tried looking for "Create web page" but I did not find anything.

I am using version 2.2.

franzlorenzon
  • 5,845
  • 6
  • 36
  • 58
LeRoy
  • 4,189
  • 2
  • 35
  • 46

1 Answers1

5

Yes, you should make them manually, it's not as straightforward as in other CMS like Wordpress.

First, you have to create some php files that includes the common parts of a Moodle web page.

As an example, create a file named about.php and place it in the root of your Moodle installation (the php code is taken from the tutorial cited above and slightly adapted):

<?php

require_once('config.php');

$PAGE->set_context(get_system_context());
$PAGE->set_pagelayout('standard');
$PAGE->set_title("About page");
$PAGE->set_heading("About");
$PAGE->set_url($CFG->wwwroot . '/about.php');


echo $OUTPUT->header();

// Actual content goes here
echo "Hello World";

echo $OUTPUT->footer();

?>

If you have your Moodle at http://moodle-example.org, your about page would be located at http://moodle-example.org/about.php.

If you'd like to, you can create a custom menu inserting the path of your newly created page.

Go to Site administration » Appearance » Themes » Theme settings. On the Custom menu items field, insert:

About us|http://moodle-example.org/about.php

Save and you'll see a menu containing a link to your newly created page.

franzlorenzon
  • 5,845
  • 6
  • 36
  • 58
  • Awesome answer @franzlorenzon. But problem is that `http://moodle-example.org/about.php` is accessible only for logged-in users. Anonymous users not able to access this. How to do this so that anonymous user can also access this url. – Nishant Sep 02 '15 at 11:12
  • 1
    @NishantPandya I think that's a moodle configuration issue. Go to: Settings → Site administration → Security → Site policies. On that page, disable “Force users to login”. – franzlorenzon Sep 07 '15 at 11:59
  • 1
    @Pacerier what theme are you using? Not everyone supports the feature. Have a look at the [docs](https://docs.moodle.org/25/en/Theme_settings#Custom_menu_items). – franzlorenzon Sep 07 '15 at 12:03
  • @franzlorenzon, It's an older version. `$version = 2007101524`. There's no "custom menu items" here. What are the options for older version? – Pacerier Sep 17 '15 at 07:38