By SDM-MINK on
Using an override theme_addthis_button function & button displaying at bottom of node. Understand that I can move $links in node.tpl.php, but can I only access the addthis button which is included in $links?
Using an override theme_addthis_button function & button displaying at bottom of node. Understand that I can move $links in node.tpl.php, but can I only access the addthis button which is included in $links?
Comments
Hi, If you use "Drupal for
Hi,
If you use "Drupal for Firebug" you can easily see the contents of the $node array. Once you have the variable containing the value of your button you can insert the button like this:
<?php print $node->content['links']['add_this_buton']['#value'] ?>Note: I'm only guessing how the vars are named. You'll have to check for yourself.
Regards
cat
Using Firebug but not Drupal for Firebug Module
Thxs! I just started using Firebug but not Drupal for Firebug Module. I can see that the button is defined in a class="addthis last" which is contained in class="links". Thus, would I insert the button using this:
print $node->content['links']['addthis_last']['#value']If not, is there another way to get the variable name without adding the "Drupal for Firebug" Module?
Once I have the variable name,
(1) will I place it after when I place this code after
if ($page == 0):and beforeor after
and before
if ($page == 0):?(2) Do I need to place it in a div class?
(3) Will it automatically not display at the bottom of the node with the other $links or do I have to put in add'l coding near
print $links;?There are several ways to get
There are several ways to get the variable names, you could use the devel module for example or use
also works with
when using devel
place your code in your node template.
use
<?php if ($page == 0): ?>to theme the teaser of your node
and after
<?php else: ?>theme the details
and don't forget the
<?php endif; ?>So your template could look like this (note that I use custom fields I created using CCK):
Teaser:
The detailed view of the node:
Just a rough outline, hopefully I didn't put errors in this example ;)
If your variable is part of the $node->links then it will display if you use
If you don't want certain things to appear from the link variable you have to call the elements you want to display with out using $node->links.
Hope that helps
cat