Drupal 7 + Pixture Reloaded

Created on 21 April 2025, 3 months ago

This module doesn´t work with Drupal 7 + Pixture Reloaded Theme unless I make changes to sites/all/themes/pixture_reloaded/template.php and copy modules/node/note.tpl.php to /sites/all/themes/pixture_reloaded/templates/note.tpl.php and make some changes on it.

At the end of template.php:

function pixture_reloaded_preprocess_node(&$vars) {
  if (!empty($vars['node']->changed)) {
    // $vars['updated_value'] = format_date($vars['node']->changed, 'custom', 'd/m/Y H:i:s');	
	$vars['updated_value'] = format_date($vars['node']->changed, 'custom', 'd/m/Y');
	$vars['updated_time']  = format_date($vars['node']->changed, 'custom', 'H:i:s');	
  }
}

In note.tpl.php just after the code to display $submited var:

<?php if (isset($node->show_updated) && $node->show_updated) :?>
	<?php if (!empty($updated_value)): ?>
	  <div class="updated-date">
		Atualizado em: <?php print $updated_value; ?> &agrave;s <?php print $updated_time; ?>
	  </div>
	<?php endif; ?>
<?php endif; ?>

Now it works. I hope it helps someone.

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇧🇷Brazil numerabilis

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @numerabilis
  • 🇺🇸United States mmarler

    Thanks for reporting this @numerabilis.

    The last updated date should be add to the $submitted variable that is printed in the node.tpl.php template:

    <?php if ($display_submitted) { ?>
        <div class="submitted">
          <?php print $submitted; ?>
        </div>
    <?php } ?>
    

    In Drupal 7 you need to enable this setting on each content type. Is it possible your content type doesn't have this enabled?

  • 🇧🇷Brazil numerabilis

    mmarler When I enabled the module it already get enabled in each content type (shows checked) and I also have to check "Display updated date" in the node "Publish Options" too but after all it didn´t work anything at all.
    So I had to make that workaround above to get the date the node was changed by database info.
    My node.tpl.php has:

      <?php if ($display_submitted): ?>
        <div class="submitted">
          <?php print $submitted; ?>
        </div>
      <?php endif; ?>
      
    <?php if (isset($node->show_updated) && $node->show_updated) :?>
    	<?php if (!empty($updated_value)): ?>
    	  <div class="updated-date">
    		Atualizado em: <?php print $updated_value; ?> &agrave;s <?php print $updated_time; ?>
    	  </div>
    	<?php endif; ?>
    <?php endif; ?>

    But I had to do like this to work. It doesn´t seems to be a mere theme problem.

  • 🇺🇸United States mmarler

    Thanks for the clarification @numerabilis. This will definitely help those using Drupal 7. Unfortunately, this module no longer supports Drupal 7 so no updates will be made to that branch. I'll keep this issue as active for Drupal 7 users to find.

Production build 0.71.5 2024