From the course: WordPress: Creating an Intranet Website

Create a front-end user experience - WordPress Tutorial

From the course: WordPress: Creating an Intranet Website

Start my 1-month free trial

Create a front-end user experience

- [Instructor] The purpose of an intranet site is to manage which users can get into the site, and what they can access and do on the site once they get there. In this chapter, we'll focus on the core of this issue, User Management. It all starts with creating a consistent user experience. Out of the box, WordPress presents content in a public facing front end, and lets those with the necessary access manage that content in a restricted back end commonly called The Dashboard or Admin Panel. On an intranet site, it makes sense to keep regular users on the front end for every task except content creation and advanced site management. And in an ideal scenario, when a user gets to the intranet site and is not logged in, they should be able to log in right from the front page. Once logged in, they should also be able to manage their account information and reset their password, all without going to the back and the WordPress. On the Landon Intranet Site, I've achieved this using two plugins. WP User Manager for a customized front-end user management experience and Conditional Blocks to control block visibility based on whether the user is logged in or logged out. Let's see how this all fits together. When WP User Manager is installed and activated, it creates new pages for account management, login, password resets, and to view the user profile. These are all regular pages with a short code as you see here to display the content. Though I expect in a near future version of the plugin, it will be using blocks instead. Some of these short codes, like the login one you see here can be customized further with parameters like Password link and register link. The settings for WP User Manager can be found under users and settings. From here you can assign different pages for different profile functions like login, password recovery, registration, and so on. Configure login settings to prevent people from accidentally going to the standard login page. You do that by clicking this box here. Prevent the Admin Bar from appearing for specific user roles like contributor and subscriber as I've said up here. Configure registration settings and customized administration emails. In this case, I've disabled all these features. Configure enhanced profile pages, including custom avatars and profile cover images. This means profile pictures don't have to be uploaded to the Gravatar service and will work even on local networks without access to the internet. Here you see I've activated custom avatars and I've disabled the profile cover image, but if I enable it, people can upload their own cover image like you would see on social media sites. And finally, you can manage redirects, so, after login, you can say what page or post or anything else you want people to go to, same with after logout, and same with after registration, and you'll notice here, I've assigned all of these to the same page, which is the Welcome to the Landon Intranet Page. So no matter what people do logging in or logging out, they always land on the same page. Now, let's go back to the front page for one second. As you can see, on the front page, we have a large navigation menu at the top, we have this text Welcome to the Landon Intranet, then we have three back ends with latest news, recent documents and manage your profile. And then we have the footer down here. But if I copy this URL, and open it in an incognito browser window, you'll see we're on the same page, the front page. We still have the page title, but we have a much smaller menu. It's only home and login. And we only have this login form. This is where that second plugin Conditional Blocks comes in. On the page, Welcome to the Landon Intranet, which I'm using as the front page. I have this block up here called the short-code block. If you go over to the Conditions Panel, you'll see here I can set up conditions for when this block is displayed. That's what the Conditional Blocks Plugin does. Here I've set this particular block to show only for signed out users. And then below, I have this Columns Block that holds the three columns. And here the condition is set show for user state signed in users. That means depending on whether you're signed in or signed out, you'll see different things in the front page. I does a login form if you're signed out, or this free bucket columns if you're assigned in. And one more thing, you'll notice when I'm logged in, you have this button up here that says log out. And when I'm logged out, we have a button that says login. This is all managed through WP User Manager. If I go to the main menu, you'll see down here actually have both of the buttons on my main menu, login and logout. When I open the settings for this button you'll see here login display to logged out to users, meaning if you're logged out, you can only see the login button. And for log out, you'll see here I've toggled this box set as Logout URL, and then I'm displaying it only to logged in users. That way, depending on whether the user is logged in or logged out, they'll get a different button and the button will do exactly what it says either log you in or log you out.

Contents