| Modify category list to show intro text of article |
| Sunday, 28 September 2008 17:26 | |||
|
Question: The default Joomla category lists are boring and not very search engine friendly as they just contain lists of linked article titles. I would like to add some spacing between the article numbers, as well as add intro text. Answer: Adding into text to the category lists is a fine idea. This how you do it. 1) Open \components\com_content\views\category\tmpl\default_items.php Around line 75 find: <?php $this->item = $item; echo JHTML::_('icon.edit', $item, $this->params, $this->access) ?> Add the following code right after. <br /> What this does is limit the intro text to 100 characters. This is good in the event you forgot to use the "readmore" break when creating an article. It also is good even if you added the readmore further down in the copy than 100 characters. By adding the intro text, this makes the page not only more interesting to humans who get a quick preview of what the article is about, it also adds more copy to the category list which the search engines like. We have noticed that the default Joomla category index pages do not acquire the PR value of the actual article pages. The above modification should help the category index pages gain some PR value. To add space between the article number and the title, find this code around line 69: <td align="center"> Change the alignment from right, to center. Note: If the new intro text expands the table cell and the article number floats in the middle of the cell, then add valign="top" to the cell above. <td align="center" valign="top"> This will cause the article number to stay inline with the article title.
|