Embedding Forward in custom themed nodes
iteego - June 10, 2009 - 05:48
| Project: | Forward |
| Version: | 6.x-1.7 |
| Component: | Documentation |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Greetings,
Since all of my nodes are custom themed the Forward link is not appearing. What is the code snippet I need to add to the node source code to get the Forward link and form to appear? I tried doing a search in the issues and did not find it. My apologies if this has already been addressed. Cheers, Kevin

#1
Even in custom themed nodes, you should still be outputting the $links variable somewhere. Here is code that should respect most of the forward settings, if you need to do it separately from the $links variable:
<?php$type = (variable_get('forward_link_type', 0)) ? node_get_types("name", $node) : 'page';
print l(t(variable_get('forward_link_title', 'Email this !type'), array('!type' => $type)), 'forward', array('query' => 'path=node/'.$node->nid));
?>
Of course, you can pare that down quite a bit if you don't need the admin settings to be respected. The main thing is link path is 'forward' and the query string needs to be in the format 'page=path/to/any/page'. So this'd be the simplest version:
<?phpprint l(t('Email this page'), 'forward', array('query' => 'path=node/'.$node->nid));
?>
#2
#3
thank seanr,
that's just what i needed. also, is there a variation on that snippet for using the embedded expanding form instead of linking to another page with the form? cheers, Kevin
#4
I did want to mention that of course I have configured the settings in admin to use form instead of link. However, this code only permits usage of link if i'm correct? cheers, kevin
#5
If you have forward set to show the form, then you should be able to just print $node->content['forward'] in your theme.
#6
that doesn't work. I just get the word Array as output.
#7
Sorry, should be $node->content['forward']['#value'].
#8
Thanks. This is really STRANGE but it works in Firefox but not IE. How could that be???
#9
Sorry, I'm a real dolt. That was just a permissions issue. It works perfect. Thanks
#10
Automatically closed -- issue fixed for 2 weeks with no activity.