Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
As we saw earlier in the chapter, Drupal can have more than one theme enabled on a site, but only administrator was able to choose the overall theme for the site. A nice feature for users is the ability to be given permission to choose their own theme. In this video, I will enable two themes and create a new generic user and show how that new user can have their own theme chosen for the site. Now, before we actually can give the user permission, we need to actually create a user. So let's do that real quick, through the Drupal Administration screen.
We're going to click Users, then we're going to click Add user. We're going to create a new user, called user2, and the E-mail address could actually be something fake, so we'll say chris@local and the password, we'll just use 'user'. So we'll make sure that the user is Active, click Create a new account. Now the new account has been created for the user2. We can then go back to the administration screen, and actually enable more than one theme in the Themes administration, because we will then give the user permission to choose one of these themes.
So we'll enable Marvin, click Save. So before I give the new user permissions to choose their own theme, let me show you what the user will see right now. So instead of logging out in my Firefox browser, I'm going to actually minimize Firefox and open a different browser. So I'm going to open Internet Explorer, and we're going to log in to the local site.
So let's copy our URL, minimize Firefox, and now we're going to paste the URL into our other theme. Instead of visiting the Administration screen, which the copied URL will take us to, I'm going to actually trim down the URL to just visit the homepage. We're going to log in with the user2 credentials. So my Username is user2 and the Password I gave that user is just user. So click Log in.
I don't want to store the password this time, and we see that Navigation is much different than our administrator. So we're going to click My account, and now we're going to click Edit, and this is actually where the user can edit their own profile. So right now, we do not see any options to choose our own theme. Let's change that. I'm going to minimize Internet Explorer. I'm going to open my Firefox, where I'm logged in as an admin, and we're going to now go to the Administer screen and we're going to choose Permissions.
This is where you can actually set all the user permissions for any feature of Drupal. Permissions, for Drupal, are actually covered in detail in the Drupal Essential Training course, also available on lynda.com. So we're going to scroll down to the System section and we see that there is a permission here, Select different theme. We're going to enable this permission to the Authenticated users only. So now we click Save Permissions, permissions have been saved, let's now minimize Firefox, and reopen Internet Explorer.
I'm going to now refresh this Edit Profile page for the user2. We now see that the user is given options in their profile page to choose their own theme. So let's have this user choose the selected theme for Marvin, click Save, and now we see user2 has now chosen their own theme and they're viewing the site in Marvin now. Since they are not a site administrator, they would not end up seeing the Garland theme again until we revoke their privileges, or change the theme on them entirely.
So now I can actually log out, and you will see that the logged out user is viewing Garland. This is because we only gave permission to choose a custom theme to authenticated users, or people who have an account to log in with. Now going back to Firefox, where we're logged in as an admin, I actually now want to disable the second theme, because we won't need it throughout the rest of this course. So I'm going to go back to Administer, I'm going to click on Themes, we're going to disable Marvin and leave Garland as the default.
We're going to click Save configuration. Now you may have noticed, I did not remove the permission of setting your own theme under the Permission screen. This wasn't necessary since we don't have more than one theme enabled right now. If you would like to remove that permission, you could do so on your own. Letting users choose their own theme is nice, but isn't always necessary. If your users need this functionality, it is built into Drupal and does not need any complex setup, as you've seen, to provide them with the ability to choose their own theme on a site.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 101850 Viewers
61 Video lessons · 88602 Viewers
71 Video lessons · 72417 Viewers
56 Video lessons · 104112 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.