Hello, I have a template and am trying to add an edit page button. Could you tell me what code I need to add into my template. I have tried the following code from the garland template.

template.php

function phptemplate_menu_local_tasks() {
  $output = '';
	
  if ($primary = menu_primary_local_tasks()) {
    $output .= "<ul class=\"tabs primary\">\n". $primary ."</ul>\n";
  }

  return $output;
}

page.tpl.php

<?php if ($tabs): print '<div id="tabs-wrapper" class="clear-block">'; endif; ?>
          <?php if ($title): print '<h2'. ($tabs ? ' class="with-tabs"' : '') .'>'. $title .'</h2>'; endif; ?>
          <?php if ($tabs): print $tabs .'</div>'; endif; ?>

However, this only prints out two random numbers. 323 and 324 I believe. it isn't creating any edit button. Is there a module or a template tag I can add to put edit buttons on the page?

Thanks.

Comments

neokoenig’s picture

As you can see on http://api.drupal.org/api/file/modules/system/page.tpl.php/6, the $tabs variable should output the edit links;

try keeping it simple:

i.e

          <?php if ($tabs != ""): ?>
            <div class="tabs"><?php print $tabs ?></div>
          <?php endif; ?>

--------------------------
OxAlto Design
http://www.oxalto.co.uk
--------------------------

Perad’s picture

Thanks for the reply. For some reason the above code outputs the following.

* -331
* -332

I just don't understand why it works on Garland yet not on the new theme. I can see precious all that is different.

Are there any steps I can do to troubleshoot this?