Chapter 9 [ 237 ] 2. Aer clicking on Register, you are taken to the home page. On the home page, Joomla! displays a system message: Your account has been created and an acvaon link has been sent to the e-mail address you entered. Note that you must acvate the account by clicking on the acvaon link when you get the e-mail before you can login. Download at Wow! eBook WWW.WOWEBOOK.COM Opening Up the Site: Enabling Users to Contribute and Interact [ 238 ] 3. Joomla! will now send an automacally generated e-mail that contains a link you must click on to acvate your new user account. You'll be taken to the home page and a conrmaon message will be displayed: Your Account has been successfully acvated. You can now login using the username and password you chose during the registraon. What just happened? You're now ocially a member of your own site! Try it out by using the Login Form on the home page. Enter your Username and Password and click on the Login buon. However, logging in as a registered user doesn't make much sense now since there's no special content that only registered users can access yet. We'll take care of that in a minute. You can also enable users to register without having to enter a valid e-mail address. To do this, navigate to Site | Global Conguraon and in System | User Sengs, set New User Account Acvaon to No. However, be aware this can lower the threshold for spammers to create fake member accounts on your site. Download at Wow! eBook WWW.WOWEBOOK.COM Chapter 9 [ 239 ] Hiding content for non-registered users Creang exclusive "member content" doesn't take much more than seng the access level of an item to Registered. This item will be hidden for regular users, but it will show up for those who have logged in. Most of Joomla!'s building blocks can be set to a specic Access Level. Whether this block is just one specic page or a module or all of the contents of a specic category, you can set it to be visible to registered users only. This basically means that you can make your site look very dierent to dierent types of users. Public users may only see a basic website; registered users have the same content plus a whole bunch of extra arcles, menus, menu links, or modules. Time for action – hiding content for non-registered users Let's explore how how hiding content works. By default, every menu item is visible: the Access Level is set to Public. We'll change that seng for the Ugly Painngs link that's currently the second link in the menu: Let's make this Ugly Painngs only visible for registered users that have logged in. 1. In the Main Menu, select the Ugly Painngs link to edit it. 2. In the menu links Parameters, set the Access Level to Registered, and click on Save. What just happened? That's it! By changing a single menu item parameter you've eecvely hidden the menu item for non-registered users. The output is shown in the screenshot below: The Ugly Painngs will only be displayed aer a registered user has logged in. Download at Wow! eBook WWW.WOWEBOOK.COM Opening Up the Site: Enabling Users to Contribute and Interact [ 240 ] Have a go hero – change access level settings Have a look at the way you can change access levels for dierent items on your site. Explore the parameters or details of any arcle, menu item, or module. You'll nd out that you'll always have the same set of Access Level choices you can set. Here's an example of the Menu Item Details you just changed: Download at Wow! eBook WWW.WOWEBOOK.COM Chapter 9 [ 241 ] If you would like to make a whole menu display only for registered users, you'd set the Access Level of that parcular menu module: What's the special access level about? You'll have noced that there are three access levels: Public, Special, and Registered. Whatever is set to Special level is only accessible to administrators. You can use this level to show content that's meant for logged in administrators only. Getting your visitors to 'register to read more' It's great to be able to completely hide contents for non-registered users, but this approach does have one drawback. It doesn't encourage users to register as they simply can't see what they are missing out on. Somemes, it's beer to show non-registered users only part of an arcle and invite them to join (register) to read more. On the example site, we'll do just that. We won't completely hide content for registered users, as this would leave a very sparse website for rst me visitors, that wouldn't really persuade them to explore the hidden stu. Download at Wow! eBook WWW.WOWEBOOK.COM Opening Up the Site: Enabling Users to Contribute and Interact [ 242 ] Time for action – partially hiding content from non-registered users Suppose your client wants to oer their site members some exclusive content; anyone registering to the SRUP site can enjoy special discounts on art supplies and other goodies. Let's create this content and make sure it's only partly shown—unless users register: 1. To create a new secon, navigate to Content | Secon Manager and click on New. Call this new secon Member Area. 2. To create a new category, navigate to Content | Category Manager and click on New. Call the new category Member Discounts. Set the Secon to Member Area. 3. To create a new arcle, navigate to Content | Arcle Manager and click on New. Assign the new arcle to the Member Area secon and the Member Discounts category. 4. Make sure to divide the arcle in an intro text and a main body text by placing the cursor directly aer the intro text and then clicking on the Read more… buon. A red doed line indicates where the intro text ends and the Read more link will appear. 5. In the Parameters (Arcle), set the Access Level to Registered: Download at Wow! eBook WWW.WOWEBOOK.COM Chapter 9 [ 243 ] 6. If you like, you can create another arcle in the same category. In this example, we've named the arcle Special Discounts for Members. Make sure to set the Access Level to Registered. 7. Create a link poinng to the new secon. Navigate to Menus | Main Menu and click on New. In the New Menu Item Type secon, select Arcles | Secon Blog Layout. Enter a Title (Member Area) and in the Parameters (Basic), select the Member Area secon as the link target. In the Parameters (Component), set Show Unauthorized Links to Yes: This last step takes care of the Register to Read More magic. Instead of completely hiding non-public arcles, Joomla! will now parally display them. What just happened? You've created some web pages that can be fully viewed by registered users only. When you preview the site, you'll see a Main Menu link poinng to the Member Area. Clicking on this link shows the teaser texts of the arcles in the Member Area secon are displayed with a Register to read more link. This way, unregistered users get a taste of the registered content: Download at Wow! eBook WWW.WOWEBOOK.COM Opening Up the Site: Enabling Users to Contribute and Interact [ 244 ] When site visitors click on the Register to read more… link they are automacally taken to a separate login page: Visitors that haven't yet created an account can click on Register to do so now. If the visitors already have an account, they can login here. You can check this out for yourself by logging in now with the dummy user account you created earlier. Enabling users to rate articles or write comments Allowing your visitors to register is a rst step to create user involvement. If you want more community interacon, you might consider enabling your visitors to rate arcles. This opon is built-in; when eding an arcle, navigate to Parameters (Advanced) and set Arcle Rang to Show. Now, users can rate an arcle on a ve point scale from Poor to Best. Download at Wow! eBook WWW.WOWEBOOK.COM Chapter 9 [ 245 ] If you want to enable visitors to rate arcles, you may want to set this for all arcles at once. Navigate to the Arcle Manager, choose Parameters and set Arcle Rang/Vong to Yes. This will enable arcle rang for all arcles you write from now on, unless you disallow rang for specic arcles. Another great way to get visitors involved is to allow them to post comments to your arcles. This gives them an opportunity to give feedback on the subjects you cover and to parcipate in discussions with other visitors. Moreover, it can show you which issues your site visitors care about. In Joomla! 1.5, a commenng system isn't pre-installed. However, there are many commenng extensions available, such as the free !JoomlaComment, YvComment, and Disqus components. You can nd more informaon on using extensions in Chapter 10; specic informaon on commenng systems is available through the Joomla! extensions website: http://extensions.joomla.org/extensions/contacts-and-feedback/ articles-comments. Pop quiz – test your knowledge of Joomla! user management 1. What's the dierence between registered users and ordinary site visitors? a. Registered users can add content to the site. b. Registered users are able to view "registered" content. c. Registered users are team members. 2. What's the use of displaying a login form on your website? a. To allow users to log in or to register. b. To allow anyone to lo g in to the backend. c. To allow users to acvate their a ccount. 3. What's the advantage of using "Register to read more" links? a. Site visitors will feel encouraged to add content. b. Site visitors will feel encouraged to register to read partly hidden content. c. Site visitors won't be able to know what content is hidden. Download at Wow! eBook WWW.WOWEBOOK.COM Opening Up the Site: Enabling Users to Contribute and Interact [ 246 ] Summary In this chapter, you learned a lot about dierent ways of user interacon in Joomla!. The following is what we have covered: In the User Manager you can create new users and assign them to a specic Group, granng them various levels of access to the site. There are ve groups available, each with their own set of permissions. Some users have access to only the frontend of the site; others have more permissions and can login to both the frontend and the backend of the site. To allow users to login to the site, you 'll have to create an entrance: a login form where they can enter their username and password. Some frontend users are only allowed to submit or edit content; they can't publish it. Another user with publishing permissions has to review their submissions and makes them visible on the site. By enabling user self-registraon a user community can develop. Registered users have exclusive access to "members only" content. To invite visitors to register you can show them o nly part of an arcle. This way, you can encourage them to explore all the hidden stu. If you want your visitors to interact you can allow them to rate arcles or to add comments, using a dedicated commenng component. Up to now, you've steadily built a ne website. It's looking good, organized clearly, easy to expand, and easy to navigate. Moreover, you've now added some advanced features to the site using Joomla!'s built-in user management capabilies. What more can you want? Much more! Now it's me to look further and explore the vast range of powerful extras by extending Joomla!. In the next chapter, you'll enhance your site and make it even beer and much more fun to use. Download at Wow! eBook WWW.WOWEBOOK.COM . is available through the Joomla! extensions website: http://extensions .joomla. org/extensions/contacts-and-feedback/ articles-comments. Pop quiz – test your knowledge of Joomla! user management 1 eBook WWW.WOWEBOOK.COM Opening Up the Site: Enabling Users to Contribute and Interact [ 242 ] Time for action – partially hiding content from non-registered users Suppose your client wants to oer. eBook WWW.WOWEBOOK.COM Chapter 9 [ 245 ] If you want to enable visitors to rate arcles, you may want to set this for all arcles at once. Navigate to the Arcle Manager, choose Parameters and set Arcle