Latest news
Tips and Tricks
Examples and Tutorials
Show context-based news |
Explains the parameter alternation concept by giving an example of how to display context-based news. This article explains how to solve the very common task of displaying different news on different pages of a website. It also gives an example of the parameter alternation concept. The problem: Why do we ever need to have context-based news? Let's say we are a company that makes hardware. We sell bluetooth devices and WiFi devices. We are probably going to organize our website with two main product sections: Bluetooth and WiFi. When our customer is on the home page we want him to see all news that we have to bring to his attention: company news and product news. When the customer goes to the Bluetooth devices section it is not a very good idea to show him WiFi news and the other way around. Although this may sound as a very specific example, a variations of it are(or at least should be) implemented in many websites. Native Joomla approach: What is the first thing that comes to our mind? We could create a section called "News" and three categories in it: Company, Bluetooth and WiFI. We will write the news as articles, each in its corresponding category. After that we will set our favourite news module to display only this or only that category. This approach works, but has some design flaws. First, we have to create three absolutely identical modules, except for the source category part. If we want to change something later we have to change it in all the three modules. And what if we had ten product sections, not two? Besides that, we have to assign different modules to different menu items - this is how Joomla is organized. Well this might not be too bad, depending on the website, but there is a much better and cleaner approach using Advanced Contexts Manager. Advanced Contexts Manager approach:
That's all. Now we have only one news module, that has a different news source based on where the user is currently located on the website. If we want to change a parameter for the module, we can easily do it for all product sections or just for one of them. Conclusion: Although this example is just for displaying news, the parameter alternation has many other possible uses. Try to think of it as a general design approach for Joomla that allows you to have fully customizable, dynamic modules. The Module Wrapper is integrated with other Enless Soft products which makes it even more flexible. On top of that, our extensions has an easy to use plug-in system that allows third party integration. |