Re: Newspaper: Interesting Problem
Posted by
Pedro on
Feb 01, 2012; 2:47am
URL: https://support.nabble.com/Newspaper-Interesting-Problem-tp7210295p7241973.html
Hi,
Harvey, it is now possible to fix the problem you described. The idea is to notify the subscribers when you move topics from the private subapp to the public area of your magazine.
To do this, see the code below:
<override_macro name="save_parent_changes">
<n.edit_page_node.>
<!-- If the URL is empty, we use the current app -->
<n.if.is_empty.trim.parent_url_field.value>
<then.parent_url_field.set_value value="[n.page_node.get_app_node.url/]"/>
</n.if.is_empty.trim.parent_url_field.value>
<!-- If same site, just move. Otherwise, export it. -->
<n.if.url_belongs_to_site url="[n.parent_url_field.value/]">
<then>
<n.set_var. name="was_private"><n.edited_node.is_private/></n.set_var.>
<n.set_parent_url parent_url="[n.parent_url_field.value/]" />
<n.save_node/>
<n.if.both condition1="[n.var name='was_private'/]" condition2="n.not.edited_node.is_private/]">
<then.edited_node.notify_subscribers/>
</n.if.both>
</then>
<else>
<!-- Hardcoded link until ExportConfirmation is templated -->
<n.set_var. name='url'>/catalog/ExportConfirmation.jtp?node=<n.page_node.id/>&url=<n.parent_url_field.value/>
</n.set_var.>
<n.redirect_to.var name='url'/>
</else>
</n.edit_page_node.>
<!-- Start tweak -->
<n.if.visitor.is_site_admin>
<then.redirect_to.page_node.change_topic_subject_path/>
<else.redirect_to.page_node.url/>
</n.if.visitor.is_site_admin>
<!-- End tweak -->
</override_macro>
You should change the "save_parent_changes" macro like shown above. The lines I've added are 10, 13 , 14 and 15.