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

Comments

seanr’s picture

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:

$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:

print l(t('Email this page'), 'forward', array('query' => 'path=node/'.$node->nid));
seanr’s picture

Status: Active » Fixed
pyxio’s picture

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

pyxio’s picture

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

seanr’s picture

If you have forward set to show the form, then you should be able to just print $node->content['forward'] in your theme.

pyxio’s picture

that doesn't work. I just get the word Array as output.

seanr’s picture

Sorry, should be $node->content['forward']['#value'].

pyxio’s picture

Thanks. This is really STRANGE but it works in Firefox but not IE. How could that be???

pyxio’s picture

Sorry, I'm a real dolt. That was just a permissions issue. It works perfect. Thanks

Status: Fixed » Closed (fixed)

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

manoloka’s picture

Hi there,

This isn't working for me. I get an incomplete url "http://mysite.com/forward?path=node/" (the node id is missing) therefore not working properly.

Also it isn't showing the icon, only show the link. In fact I'd like to show my own custom icon, how can I do that?