Blog

Joomla 2.5 - Finder Component

Joomla 2.5 introduced a new search component as an alternative to the old one. The finder or smart search component. It has a lot of awesome features that really improve the search experience. We really like it so far!

One thing to look out for is trashed articles. When you trash an article in Joomla its state in the system is changed but it is still in the database. When you index content in the smart search these articles will also be added. So it is a good idea to get rid of them beforehand. Otherwise you'll end up with links to 404 pages in your search results.

Add a comment! Read more...

Add link rel="prev/next" to your blog

Google has been trying to improve the way it detects duplicate content on a website. URLs with parameters, such as the ones used for pagination, are tricky. You have the option to add a link tag to help Google identify this content. To read more about this check out the blog post in the Google webmaster blog.

To implement this in a Joomla template you can add the code in the overrides. For example you can open root/templates/your_template/html/com_content/blog.php. Inside it add this code:

// Add rel=prev/next
// http://googlewebmastercentral.blogspot.com/2011/09/pagination-with-relnext-and-relprev.html
$doc =& JFactory::getDocument();
$pagdata = $this->pagination->getData();
if($pagdata->next->link){
 $doc->addHeadLink( $pagdata->next->link, 'next');
}
if($pagdata->previous->link){
 $doc->addHeadLink( $pagdata->previous->link, 'prev');
}

The variable $pagdata contains all the information about the pagination for the current page. We simply make a check for a next or previous page link. If there is one it means the page with other items exists so we can add the link tag. We do this with the addHeadLink function.

4 comments Read more...

Adding a login popup to a gantry template

Before reading the tutorial there are two important points. First, there is a very similar tutorial on the Gantry framework website you might want to check. They use a module and rokbox while we want to use the component and a lightbox jQuery plugin. Second, if your template is not based on Gantry you should still be able to use the same idea, only you'll edit a module override instead of a feature.

Add a comment! Read more...

Multiple class CSS selector

This is a handy tip not many know about, yet it is very simple. When starting to learn CSS you learn about classes and how you can use many classes on an HTML element. Here comes the cool part, you can also use CSS selectors to match an element with more than one class. Consider the following code:

<a href="#" class="toggle enabled" title="Toggle"></a>

With the following CSS:

.toggle{
display: block;
height: 20px;
width: 20px;
background: url(myimage.png);
}

2 comments Read more...