I'm using Moodle 3.0.1.
Custom pages are displaying before login,
And custom pages are not displaying once the user logged in.
How do we display custom pages after logged in too?
if (isloggedin()) { .... }
Please try to avoid posting teh same question in multiple places
Hi,
I am intregued to find out how you created the Custom pages? And also how you added them?
Cheers
Mary
Hi Mary,
Step - 1
I installed klass theme and created a custom file like contact.php and placed in root folder.
included header & footer files using the following code.
include('config.php');
echo $OUTPUT->header();
echo "Contact Content Here";
echo $OUTPUT->footer();
Step - 2
Site Administrator -> Appearance -> Themes -> Theme Settings
Menu item name "Contact Us" added in the block "Custom Menu Items" and given url
ex :- Contact Us|http://localhost:8080/yoursite/contact.php
That's it,
But, Those created pages are not displaying after login.
Please let me know if you get the solution on this.
Thanks in Advance
Please see the answers to your other very similar question, which gives two alternative methods for creating theses pages
1. Using the page api (best if you are creating a page for distribution with a theme or other plugin)
2. Creating a front-page Page resource (best if you are adding content to a specific site)
What you are attempting to do is complex. The only theme I know that does such a thing outside of core pages is Shoehorn and that took me ages to work out. The pages here: https://github.com/gjb2048/moodle-theme_shoehorn/tree/master/pages are linked to and then have their own page layout: https://github.com/gjb2048/moodle-theme_shoehorn/blob/master/config.php#L198-L203. The content comes from the theme settings - long story - look at the code for inspiration.
Also flexibase https://github.com/roelmann/moodle-theme_flexibase/tree/master/pages as per the discussion linked to in my previous post
I would be more inclined to create a page via Moodle as a Resource, that way it works like any other page in Moodle.
For this use - of a page in one site, I compleltely agree with Mary, as she has already said this in another thread, and which again highlights the need not to be cross posting the same issue in multiple places
Of course there is always integrating with Wordpress for site wide static pages - like moodle.org.
Did you mean moodle.net, Gareth? I didn't think the .org site used WP anywhere (although I believe it does use mediawiki for the docs pages)