Joomla 3 How to change article layout main page

Where to find your own template in Joomla 3:
Home-<domain>-templates-<your template>-html-com_content-featured.
Featured is necessary for your overrides (http://magazine.joomla.org/issues/issue-feb-2013/item/1059-tutorial-taking-advantage-of-alternative-layouts-for-articles-and-modules). Now we will change the look and feel of an article in the mainpage.
This is managed in file: default_item.php

Elements look for are:

  • Intro image
  • article title
  • article category; but clickable for go to all articles with that category

Goal is following order is; image, category, title

TITLE

Open file default_item.php in an editor.

Look for : “show_title” what I do is place one comment line before this block of php code and after in sense like <!–article title> and <!–end article title–> so you can later find this back easily.

we move this block just before the initialize php block or what ever this is needed for.

INTRO IMAGE

Look for: image_intro

Do same here with comment lines <!–intro image–> and <!–end intro image–>

take this block and move it just after the end comment line of the article block.

CATEGORY

look for show_category

Do same here with comment lines <!–category–> and <!–end category–>

This part is a bit more difficult it is build up in a list with html <dl> tag.

I just want the category name and not the lable so if you remove ‘COM_CONTENT_CATEGORY’ the label is not shown.

I am also not so bothered about configuration via Joomla Admin so I just take this line of code to the top and switch of the rest in Joomla admin. You can also decide to delete all other code you don’t want.

No comments yet.

Leave a Comment