Hi,

right now i`m trying to make the two links "Edit this revision" and "Revert current revision" appear on pages using custom node templates. If i use the standard node.tpl.php everything is fine. I have the feeling this is quite an easy task but i can`t figure out how to do it. Can anybody pleas point me in the right direction? Thanks in advance.

Regards

Stephan

Comments

rdeboer’s picture

The documentation page Subtheming Quick and Dirty may get you on track ...
It has some step-by-step examples for restyling and restructuring your page with minimum effort.
The templates that you want to override (via your subtheme) are in ... /sites/all/modules/revisioning:

revision.tpl.php
revision-submenu.tpl.php
revisions-summary.tpl.php

Just copy these files to your subtheme folder (as explained in detail in the aforementioned doc page) and edit to your heart's content!
I suggest you download the latest development version of Revisioning, as it has a couple of minor improvements regarding these templates.

bimmelim’s picture

Title: Custom node templates » Revisioning links not appearing when using custom node templates
StatusFileSize
new38.04 KB
new74.89 KB

Thanks for helping me out! In fact, i don`t want to theme the links rather making them appear on my node. I`m using a custom node template file for my news, called node-news_article.tpl.php. This is how it looks like:

<div id="node-<?php print $node->nid; ?>" class="node<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?> clear-block">
  <?php if ($page == 0): ?>
    <h2><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>   
  <?php endif; ?>   
  <?php print $picture ?>     
  <div class="content">  
  <div id="news-head-container">
  <div id="news-head-image-container">
  <div id="news-head-image">
  <?php print $field_news_image[0]['view']; ?>
  </div> 
  </div>
  <div id="news-head-teaser-container">
  <div id="news-head-teaser-created">
  <?php print format_date($node->created, 'custom', "d.m.Y"); ?> 
  </div>
  <div id="news-head-teaser">
  <?php print $field_news_teaser[0]['view']; ?>
  </div>
  </div>
  </div>
  <div id="news-body">
  <?php print $node->content['body']['#value']; ?>
  </div>
      <div id="news-files">
  <?php print $node->content['files']['#value']; ?>
  </div>
   <?php if (!empty($field_nodereference)): ?>
 <?php print $node->content['field_nodereference']['#children']; ?>
  <?php endif; ?> 
  
  </div> 
<?php if ($links): ?>
    <?php if ($picture): ?>
      <br class='clear' />
    <?php endif; ?>
  <div class="links"><?php print $links ?></div>
<?php endif; ?>
</div>

I also appended a screenshot called "Custom_Node_Template.jpg" to show how it looks like in the browser. As you can see, the links to edit, publish or revert the current revision are not showing.
Now, if i delete the node-news_article.tpl.php file, the standard node.tpl.php is used.


<div id="node-<?php print $node->nid; ?>" class="node<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?> clear-block">
  <?php if ($page == 0): ?>
    <h2><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>
  <?php endif; ?>
  <?php print $picture ?>
  <div class="content">
  <?php print $content ?>
  </div>
<?php if ($links): ?>
    <?php if ($picture): ?>
      <br class='clear' />
    <?php endif; ?>
  <div class="links"><?php print $links ?></div>
<?php endif; ?>
</div>

Now, the links appear above the news text right below the tab bar. See screenshot Standard_Node_Template.jpg. Is there any chance to get this working with the custom node template file?
Besides, sorry for using a not so distinct title.

Best regards
Stephan

rdeboer’s picture

Hi Stephan,
I managed to reproduce your issue.
Just replace the line

  <?php print $node->content['body']['#value']; ?>

by

  <?php print $content; ?>

and you should be fine!
Rik

rdeboer’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.