Joomla cho người mới bắt đầu part 24 ppsx

10 277 0
Joomla cho người mới bắt đầu part 24 ppsx

Đang tải... (xem toàn văn)

Thông tin tài liệu

Chapter 9 [ 237 ] 2. Aer 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 acvaon link has been sent to the e-mail address you entered. Note that you must acvate the account by clicking on the acvaon 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 automacally generated e-mail that contains a link you must click on to acvate your new user account. You'll be taken to the home page and a conrmaon message will be displayed: Your Account has been successfully acvated. You can now login using the username and password you chose during the registraon. What just happened? You're now ocially 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 buon. 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 Conguraon and in System | User Sengs, set New User Account Acvaon 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 Creang exclusive "member content" doesn't take much more than seng 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 specic Access Level. Whether this block is just one specic page or a module or all of the contents of a specic category, you can set it to be visible to registered users only. This basically means that you can make your site look very dierent to dierent types of users. Public users may only see a basic website; registered users have the same content plus a whole bunch of extra arcles, 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 seng for the Ugly Painngs link that's currently the second link in the menu: Let's make this Ugly Painngs only visible for registered users that have logged in. 1. In the Main Menu, select the Ugly Painngs 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 eecvely hidden the menu item for non-registered users. The output is shown in the screenshot below: The Ugly Painngs will only be displayed aer 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 dierent items on your site. Explore the parameters or details of any arcle, 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 parcular menu module: What's the special access level about? You'll have noced 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. Somemes, it's beer to show non-registered users only part of an arcle 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 oer 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 secon, navigate to Content | Secon Manager and click on New. Call this new secon 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 Secon to Member Area. 3. To create a new arcle, navigate to Content | Arcle Manager and click on New. Assign the new arcle to the Member Area secon and the Member Discounts category. 4. Make sure to divide the arcle in an intro text and a main body text by placing the cursor directly aer the intro text and then clicking on the Read more… buon. A red doed line indicates where the intro text ends and the Read more link will appear. 5. In the Parameters (Arcle), set the Access Level to Registered: Download at Wow! eBook WWW.WOWEBOOK.COM Chapter 9 [ 243 ] 6. If you like, you can create another arcle in the same category. In this example, we've named the arcle Special Discounts for Members. Make sure to set the Access Level to Registered. 7. Create a link poinng to the new secon. Navigate to Menus | Main Menu and click on New. In the New Menu Item Type secon, select Arcles | Secon Blog Layout. Enter a Title (Member Area) and in the Parameters (Basic), select the Member Area secon 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 arcles, Joomla! will now parally 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 poinng to the Member Area. Clicking on this link shows the teaser texts of the arcles in the Member Area secon 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 automacally 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 interacon, you might consider enabling your visitors to rate arcles. This opon is built-in; when eding an arcle, navigate to Parameters (Advanced) and set Arcle Rang to Show. Now, users can rate an arcle 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 arcles, you may want to set this for all arcles at once. Navigate to the Arcle Manager, choose Parameters and set Arcle Rang/Vong to Yes. This will enable arcle rang for all arcles you write from now on, unless you disallow rang for specic arcles. Another great way to get visitors involved is to allow them to post comments to your arcles. This gives them an opportunity to give feedback on the subjects you cover and to parcipate in discussions with other visitors. Moreover, it can show you which issues your site visitors care about. In Joomla! 1.5, a commenng system isn't pre-installed. However, there are many commenng extensions available, such as the free !JoomlaComment, YvComment, and Disqus components. You can nd more informaon on using extensions in Chapter 10; specic informaon on commenng 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 dierence 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 acvate 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 dierent ways of user interacon in Joomla!. The following is what we have covered:  In the User Manager you can create new users and assign them to a specic Group, granng 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-registraon 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 arcle. 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 arcles or to add comments, using a dedicated commenng 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 capabilies. 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 beer 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 oer. eBook WWW.WOWEBOOK.COM Chapter 9 [ 245 ] If you want to enable visitors to rate arcles, you may want to set this for all arcles at once. Navigate to the Arcle Manager, choose Parameters and set Arcle

Ngày đăng: 04/07/2014, 17:20

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan