Hi all,

I know I have to be missing something... but is there an equivalent of 1.x's [node-link] token in 2.x?

I just want to display the title of the node as a link in the message, which was simple enough in 1.x, but don't see anything that works in 2.x ([menu-link-title] didn't work when I tried it in 2 scenarios). I'm attempting to use it for both comment and node activity types.

[author-link] works properly for the node author part of the message.

Thanks!

Comments

liliplanet’s picture

subscribe, thx!

Scott Reynolds’s picture

This was brought up in this issue as well: #473946: Provide clean url tokens to node author profile. We need to do this I think, its now just a matter of figuring out which tokens to provide links for.

Apollo610’s picture

Thanks Scott.

In the issue from May that you referred to above, you mention using comment_activity_token_list() in the appropriate .inc file in order to create customized tokens for Activity.

If I wanted to essentially reuse the node URL token initialization from Activity 1.x $data['node-link'] = l($data['node-title'], 'node/'. $data['node-id']);, what would the syntax be to do this in 2.x?

I'm unsure of what other people would use as far as linked tokens are concerned, but if I were to start a list I'd want:

1) Author-Link (to profile) (included)
2) Node-Link
3) Comment-Link

Apollo610’s picture

Status: Active » Closed (duplicate)

Actually, you know what... although the URL-specific tokens would be nice, with the given set of tokens and HTML markup I'm able to do essentially what I want anyhow.

It's slightly more work, but I'd take that trade-off for the flexibility that I'm given any day.

I'll flag this as a dup, so the other thread will still be the primary discussion should you still want to go this route.

Thanks guys -

igorik’s picture

Status: Closed (duplicate) » Active

Hi

I am not sure, if it is duplicate, the link from Scott is about clean url to author profile, this is about clean url to node.

Currently the only option to get url is node/xxx which is not the best solution.

Thanks
Igor

Apollo610’s picture

Igor, to get a clean url to a node in activity you can plug something like the following into your activity format: [author-link] just published a new blog titled "<a href="[node-url]"><strong>[title]</strong></a>"!

The clean URL [node-link] would eliminate the need to do the a href statement, sure, but there are current ways around it.

There really should be a single thread for "clean URLs in activity", since they're essentially all the same thing just varying destinations. IMO leaving this open is essentially a duplicate but no harm leaving it open till things are figured out.

sirkitree’s picture

Status: Active » Closed (won't fix)