Written by Marco Conti Friday, 29 May 2009 00:00
A few years ago I wrote an article titled "Creating a static Joomla Homepage". It is consistently one of the most read articles in my blog.
While sticking a "welcome to my site" article on your home page has dubious merits, many site owners and clients still feel compelled to do so (as am I, if you landed on my home page). But for the novice Joomla designer this "welcome" text happens to be one of the hardest things to do in Joomla. From their point of view it's simply counter intuitive that a system like Joomla, with all the incredibly advanced features it has, would not be able to simply stick an article at the top of a page and leave it there. Well, it doesn't. Or at least it doesn't in its native format.
Since my previous article was based on Joomla 1.0, some of the tips I outlined there are no longer valid or may seem flat out wrong.
In this article I am going to try to rectify this.
Method 1: Custom Frontpage Ordering
When you create any link in Joomla, the link itself carries many parameters that control the way Joomla will display the page loaded from that link. Things like displaying the byline (the "written by..."), date, date modified, etc.
The "Home" link is no different. Among other things it allows you to set the column layout of the home page, how many articles it will display and many other settings.
If you don't use your FrontPage as a news page but you would like to display a few articles in a specific sequence, then all you need to do is to go to the Home menu link in the "Main Menu" (Cpanel ==> Menus ==> Main Menu ==> Home) open it up and under "Parameters (Advanced)" you'll find two drop down fields:
Category Order
Primary Order
Leave the "Category Order" field alone and set the "Primary Order" filed to: "Order".
Now, you can simply go to Content ==> FrontPage Manager in the administration menu and use the arrows or the numbered fields next to the Article Titles to reorder your articles in the order you prefer.
By default, Joomla will always order your sections and categories articles in chronological order, meaning that your latest article will always show up at the top of the page.
Method 2: Category or Section Blog menu item with Cat/Sect. Intro
In this method we are going to get tricky. No one says that your Home page link has to be the "FrontPage". FrontPage is actually a Joomla component, the same as the com_contact component, or any other component you download and install.
What that means is that instead of using the FrontPage component we can simply assign the Home link to a custom link of our choosing.
For instance, in one case I created a Category and I called it "Home". Then I assigned it to the Home link (in your Menu Manager ==> Main menu, check the box next to the new link, then click on "default") and I reorder it to the top of the menu.
What did I do with the Home page? Simple. The client needed a lightweight blog and they did not want to spend money buying the excellent "MyBlog" component from Azrul.com.
So, instead I set up the FrontPage component to serve as their blog.
The advantage of Using the FrontPage component as a blog is that you can publish to it any article from any Section/Category you want. Even "Uncategorized" articles can end up there if you so wish.
For them it was a good solution and it also allowed them to customize their Home page in a way that was more suitable to their site's design.
Incidentally, for the articles ordering in the new Home page, you'll need to proceed as in Method 1, but when it comes to ordering the articles you'll need to go to the "articles manager" an, after selecting the Section/Category name in the drop down (to eliminate articles from other categories) once again use the arrows or the numbers to order the articles.
Method 3: Module Position above content
This Method is my favorite as it allows the most flexibility. It involves some minor coding and some knowledge of HTML and CSS (and a sliver of PHP) but it returns the best results without compromising the functionality of the site in any way.
Essentially, for the experts out there, it involves creating a new module position (if one is not already there) above the "Component" JDoc statement:
<jdoc:include type="component">
Once the new position has been inserted there, it's a simple matter of assigning a module to it and writing your "welcome" text in that module.
But... there is still a better way.
The problem with writing content in a module is that you have to remember where it is, it won't show up in a search an, if you have staff writing your content, it will be very hard for them to keep the text updated.
The solution, is to stick in that "position" a module that can import an article and display it as content. That way, the text itself will still be manageable in the Article area but it will seamlessly publish where you need it.
One good module to accomplish this is the "Newsflash" module. Newsflash, a core module, displays any articles from a category you choose. In fact, Newsflash can even rotate your content randomly or display more than one article at the same time.
An even better option, for my money, is instead to use a custom module that's even more specific than "Newsflash" and that allows you to display an article by entering its ID in the module admin screen or as a tag in the module HTML area.
For those of you that are completely lost at this point, fear not. In my next article I will explain how to go about placing a module position in your index.php template file and how to configure it to display any article you wish.
Until then, good luck and Keep on Joomla!
Method 4: There is no method 4.
I am sure that if I think about it hard enough, I'll find a method 4. But why? The methods above are plenty good enough, they are easy and they are foolproof.
| < Prev |
|---|
Conticreative offers Individual and Corporate training (in person or online) on Joomla, Wordpress, Zen Cart and other leading Open Source scripts.