Different content for logged in Student than non-logged in

Re: Different content for logged in Student than non-logged in

by Chris Kenniburg -
Number of replies: 0
Picture of Particularly helpful Moodlers Picture of Plugin developers
If you download evolve-D and look at the layouts you will see how I pulled it off.  

In   layout / frontpage.php you will find the following:

<!-- Start frontpage on off toggle (Shows frontpage login and information box)-->

  <?php 

        if($PAGE->theme->settings->togglefp==1 && isloggedin()) {

            require_once(dirname(__FILE__).'/includes/fpcustom_lgin.php');

        } else if($PAGE->theme->settings->togglefp==2) {

            require_once(dirname(__FILE__).'/includes/fpnormal.php');

        } else if($PAGE->theme->settings->togglefp==1) {

            require_once(dirname(__FILE__).'/includes/fpcustom.php');

        } 

    ?>

I have 2 frontpages (custom and normal) and two different states (logged in and logged out).  This code either displays a nice login or a simplified custom homepage via a php insert.  Otherwise it will show the normal Moodle frontpage depending on a toggle in the theme admin.

Hope this helps.  Several people on here helped answer my questions and I was able to make my theme.  Best of luck.