Path

ezpublish / documentation / ez publish / technical manual / 4.x / features / notifications / adding a "keep me updated"...


Caution: This documentation is for eZ Publish legacy, from version 3.x to 6.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

Adding a "Keep me updated" button

This part of the 4.x documentation is for eZ Publish 4.0, only reference section is common for all eZ Publish 4.x versions as well as eZ Publish 5.x "LegacyStack", please select the version you are using for the most up to date documentation!

A user can subscribe for subtree notifications for the page that is being viewed by making use of a "Keep me updated" button. Many of the default templates do not contain this button. The only exception is made for the forum pages where the button code is included into the following templates:

  • design/your_siteaccess/override/templates/full/forum.tpl
  • design/your_siteaccess/override/templates/full/forum_topic.tpl

Returning to the previous example, if you have a set of articles located under a folder called "Business", your users will not be able to subscribe for subtree notifications for this folder as long as there is no "Keep me updated" button there. Please note that the user must be logged in to make use of this feature.

You can easily add the "Keep me updated" button by inserting the following code into the override templates. For example, you can add this code to the "design/your_siteaccess/override/templates/full/folder.tpl" template:

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

After clearing the caches, the "Keep me updated" button will appear every time a user is viewing a folder. The same changes can be easily done for your articles and other content objects.

Please note that some of the default templates may already contain a "/content/action" form. In this case, make sure that all the variables listed in the above code fragment are present inside this form in the template. You can also have several forms posting data to"/content/action".

If you wish to have the button present in the page layout then you'll have to do it a bit differently. The reason for this is that the $node variable is not present in the page layout.

{* Check if we have a node... *}
 {if $module_result.node_id}
 
 <form method="post" action={'/content/action'|ezurl}>
 
 <input type="hidden" name="ContentNodeID" value="{$module_result.node_id}" />
 <input type="submit" name="ActionAddToNotification" value="Keep me updated" />
 
 </form>
 
 {/if}

Svitlana Shatokhina (10/02/2006 8:25 am)

Ricardo Correia (17/04/2013 3:21 pm)

Balazs Halasy, Geir Arne Waaler, Ricardo Correia


Comments

There are no comments.