Creating new page types in a theme

Creating new page types in a theme

by Kieran Briggs -
Number of replies: 1

Hi all.

I'm using Moodle 3.5.2 and currently the snap theme, although this query is about themes in general, and have a need to style up the page you get taken to when self enrolment is turned one.  According to the Page info, it is 

  • General Type - incourse
  • Pagetype - enrol-index

Example of Self Enrol Page

Is it possible to change the page type to something else and then create a new layout in config such as enrolmentpage.php

If so, how?

Thanks

Kieran

Average of ratings: -
In reply to Kieran Briggs

Re: Creating new page types in a theme

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers
I don't think you can create a new page type, but what I have done in the past is to use a conditional statement based on the page type
If pagetype = enrol-index { do this code }
else { do standard incourse layout code }

OR
If the changes can be done in css, rather than needing html/php changes, then you can just use the body class created by the page type. You can do a lot with bootstrap by overriding the css, including layouts smile