Customization of “Submitted by” Node Field

When a user posts a new node content, by default there’s data below the title that provides info on the user who posted the content and the date on which it was posted. For example:

Submitted by Admin on Sat, 11/09/2013 – 21:05

Personally it took me a while to understand how this field could be customized for example to “Posted by Admin on 24 Mar 2014”. The customization involves:

  • template.php
  • a pre-processor function (which is placed in the template.php)
  • PHP date() function – it would be great if you had deeper understanding of this function. Just head over to PHP.NET for more info on this function.

In this case, I used Bartik as my template; the default template for any Drupal 7 installation. The pre-processor function used is the theme pre-processor for the node i.e.

function bartik_preprocess_node(&$variables) {


All pre-processor functions are housed either in Continue reading Customization of “Submitted by” Node Field

June 19, 2014

Posted In: Information Technology

Tags: , ,

Leave a Comment