By jnicola on
Hey everyone!
I build a fair bit of basic service industry sites, and I have an idea that would vastly improve the intuitive nature of content administration on sites I build!
Basically I have a content type "service", which are all shown as full nodes in a view. I believe if there were an edit tab visible to content administrators for each node, much like on individual page renderings, the content admin would have an easier time.
It occurred to me I could do some custom php code to detect user id, then output a custome edit link if so... however I would like to believe there is an easier way. I surely am not the only person encountering this issue!
Comments
Okay so no one answered the
Okay so no one answered the question, but I managed to come up with my own solution:
Essentially, you can't render $tabs in node.tpl.php. You can however manually create your own tabs. You simply create a php if statement for if you are user number (1 for super admin). If so, then render a link as follows: node/ $nid /edit.
Anyways, that's the short version. I have the full explenation and code of how it all works on my site:
http://www.jessenicola.com/blog/drupal-6-tabs-nodetplphp
Better Solution...
Better solution...
In your template.php...
Then you can print the following in your node.tpl.php ...
Urm whts tht if ?
On your explanation the first if is not doing anything. Also the syntax is bad.
<?php echo ($tabs) ?: null ?>is the correct syntax :)