Exercises
It’s time to apply the knowledge about overrides acquired in this chapter through the proposed exercises.
Exercise 1 – Create a module override
In this exercise, you are going to create a new override for the login module. We want to inject text into the login module once the users are logged in to warn them about the session expiration:
- In the Cassiopeia template, create a new override for mod_login. In
/html/mod_login
, we can find two new files, nameddefault.php
anddefault_logout.php
, respectively. - Since we want to edit the view of the module once users are logged in, we are going to edit only the
default_logout.php
file. - Delete the
default.php
file through the Delete File button. - Open the
default_logout.php
file and add the following code prior to line 36 of the file:<p class="text-center">
Please note that your session will expire 15 minutes after your last action.
</p>
- Click on the Save & Close button...