Forums / Developer / Notifications / Comment42762

Author Topic

Paul Borgermans

Thursday 07 April 2005 5:54:48 am

Comment42762

You only need to specify the node id for notifications to work:

<form method="post" action={"content/action/"|ezurl}>
<input type="hidden" name="ContentNodeID" value="{$node.node_id}" />
<input class="button" type="submit" name="ActionAddToNotification" value="Keep me updated" />
</form>

If you do this in a pagelayout, be aware that the $node variable is not set (you will have to fetch it from the $module_result variable):
So for a pagelayout.tpl, do something like this:

{let node=fetch(content,node,hash(node_id,$module_result.node_id))}
{*...*}

 {section show=$node}
{*the above avoids the notification button appearing if not in node view mode*}
 <form method="post" action={"content/action/"|ezurl}>
 <input type="hidden" name="ContentNodeID" value="{$node.node_id}" />
 <input class="button" type="submit" name="ActionAddToNotification" value="Keep me updated" />
 </form>
 {/section}
{*...*}
{/let}

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans