Search

Joomla - Minimize Display of Article's Authoring Details

Contents[Hide]

JoomlaIf you run a Joomla site with a blog layout and you need to display authoring details (creation date, writer, ...) of your articles, you may have noticed these details are taking quite a huge display space.

By default they are displayed with this setup :

  • one line per item (creation date, update date, writer, ...)
  • Label Detail at the beginning of the first item
  • default date format very long (like Wednesday, 01 January 2014 10:00)

This article explains the simple steps needed to minimize article's authoring details to a single line on a typical Joomla site.

joomla-authoring-before

will become

joomla-authoring-result

This setup has been tested on a Joomla 2.5 installation.

1. Shorten Authoring Labels

If you plan to get all the authoring details (creation, update & author) on the same line, first step is to shorten all the authoring labels and the date format.

This can be done easily in Joomla as all these labels and format specifications and handled thru some variables that can be overridden thru the administration interface.

All these modifications are done thru the tab Overrides in the menu Extensions / Langage manager.

To override any label or date format :

  • click on the New button
  • in the search field enter the label you want to modify and hit Search
  • or in the search field enter the key you want to modify, select by key and hit Search

You should be presented with a list of keys result of your search. You now need to :

  • select the key
  • modify the label in the left part
  • save it

That's that simple.

All fields modified thru this menu will be stored on your site under /your-web-site-root/language/overrides/en-GB.override.ini, where en-GB will be replaced by the langage selected for the key.

1.1. Remove "Details" header

The Details header is defined in the key COM_CONTENT_ARTICLE_INFO.

To remove it, you just need to save it empty.

1.2. Shorten Date Format

The date format header is defined by the key DATE_FORMAT_LC2.

By default you get a very long date format like Wednesday, 01 January 2014 10:00.

This string defines the displayed date format strictly following PHP Date format. So you can easily adjust it to whatever format needed.

1.3. Shorten Labels

Different authoring labels are defined by the keys :

  • COM_CONTENT_CREATED_DATE_ON
  • COM_CONTENT_LAST_UPDATED
  • COM_CONTENT_WRITTEN_BY
  • ...

%s will be replaced by the data.

1.4. Result

Here is the setup used to display authoring details on this site :joomla-authoring-step1

Key Original label Shorten label
COM_CONTENT_ARTICLE_INFO Details empty
DATE_FORMAT_LC2 l, d F Y H:i j M Y
COM_CONTENT_CREATED_DATE_ON Created on %s Created on %s,
COM_CONTENT_LAST_UPDATED Last updated on %s updated on %s,
COM_CONTENT_WRITTEN_BY Written by %s by %s

 

2. Place Details on a Single Line

Now that all fields have been shortened we just need to have them aligned on the same line.

This can be done by some simple modification of your template's CSS for the associated dd fields.

In fact, you need to declare all the fields, other than the last one, as floating and left aligned float:left.

joomla-authoring-resultLeft and right margin should also be adjusted.

To get the same result as this site, these two lines should be added at the end of your template.css :

/your-web-site-root/templates/your-template/css/template.css

...

dd.create { margin-left:0px; margin-right:4px; float:left; }
dd.modified { margin-left:0px; margin-right:4px; float:left; }
dd.createdby { margin-left:0px; }

 

Hope it helps !

Signature Technoblog

This article is published "as is", without any warranty that it will work for your specific need.
If you think this article needs some complement, or simply if you think it saved you lots of time & trouble,
just let me know at This email address is being protected from spambots. You need JavaScript enabled to view it.. Cheers !

icon linux icon debian icon apache icon mysql icon php icon piwik icon googleplus