distinguishing between head post and subsequent posts

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

distinguishing between head post and subsequent posts

nnako
This post was updated on .
Hi,

I wrote the following macro in order to append an information line within a notification eMail text:

<macro name="subscribe_line" parameters="format" requires="subscription">
    <n.set_local_user.this_subscription.user/>
    <n.set_local_node.page_node.get_app_node/>
    <n.if.not.local_user.has_subscription_to_descentants_of.local_node>
        <then>
            <n.if.equal value1="[n.format/]" value2="html">
                <then>
                    ...subscribe to topic <n.node.subject/> by <a href="[n.root_node.base_url/][n.page_node.topic_node.subscribe_path/]">clicking here</a>.<br/>
                </then>
            </n.if.equal>
        </then>
    </n.if.not.local_user.has_subscription_to_descentants_of.local_node>
</macro>

When a user gets notified and does not have a subscription to descendants of the local node (the "local node" equals the posted object), an information line is added to the notification that provides a clickable link for subscription purposes. Now, I want to distinguish between a "local node" which is the start of a new thread/topic and a "local node" which is a subsequent posting within the thread/topic. If I could distinguish these, I would add the information line only when the "local node" was the starting post of a new topic. Right now, the user gets this information line in every notification. And even with changing node.subject content respective to its node type.

Which code snippet could I use in NAML to distinguish the type of nodes when in "only new topics" subscription mode?

Just to know if the "local node" is a start of a topic (topic node) or one of the subsequent posts (post node).

Thanks.