Needs work
Project:
Node Comments
Version:
6.x-3.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 Jun 2009 at 23:42 UTC
Updated:
8 Sep 2011 at 10:41 UTC
Jump to comment: Most recent file
Comments
Comment #1
mitchell commentedOr, is it possible to save the node-comment target as a node reference?
Comment #2
webchickI'd like this too.
Comment #3
merlinofchaos commentedToken isn't very good at having multiple nodes. Maybe with token 2.x
Comment #4
vood002 commentedWould love to see this.
I built a discussion rss feed which aggregates all of the node comments (and forum topics) on my site--only problem is if you click through the link it takes you to the comment node, rather than it's parent node.
If the parent NID were a token, I'm assuming I could use pathauto to this effect: node/[pid]#reply-[nid]
EDIT now that i think about it the pathauto way definitely won't work. I may be able to achieve it with views, i'll post if I find a good way.
If there's another way to do this I'd appreciate advice as well.
Comment #5
friolator commented@vood002:
We have a custom breadcrumb trail for certain sections of our site, that's based on the current path. We're still using paths that contain named anchors, for the nodecomment view of all the comments attached to a node. This is there so you can make a link to that comment in the context of the overall thread. The big problem for us was in search results for the site. Nodecomment nodes would be linked to via their node id (node/nid), but we needed for the path to show the context of the comment, in order to work inside of our breadcrumb trail. This is especially important with search results, where you'd be taken to the nodecomment as a standalone post. The breadcrumb becomes critical for letting you know where you are.
Our breadcrumbs would come out all weird if the path generated by pathauto was 'forum/comment-title' vs 'forum/container/forum/node-title/comment-title' -- in the case of the latter, we can construct a breadcrumb that lets the user navigate back up easily. Also, we needed that for the case where (in search results), you're linked directly to the node.
Ok, that said, I did this:
So, this gives us a [node-comment-parent-path] token for use in pathauto. What we've done is set up the following paths:
Forum Topic: forum/[termpath-raw]/[title-raw] (gives us 'forum/container/forum/node-title')
Forum Reply: [node-comment-parent-path]/[title-raw] (gives us 'forum/container/forum/node-title/comment-title')
So far, this seems to work fine. I suppose this could be patched into nodecomment itself if people find it useful enough. The only catch I can see is that "forum_reply" is specific to our site. I guess it should just check for the existence of $object->comment_target_nid, and if it's there, go ahead and make this token. (unless there's a better way)
Comment #6
crea commentedClosing all issues. Please reopen if still relevant.
Comment #7
hexblot commentedThis is a patch that is based on the above post by friolator. It patches the nodecomment.module file to add three new tokens that I needed in my advanced forums:
The patch can be applied to both the current 6.x-2.x-dev version ( packaged on 2010-07-20 ) or 6.x-2.0-beta6 without problems. I have only used it in the staging environment of a large forum, but will soon go live with it as I don't expect any odd behavior.
I hope this helps someone, it proved invaluable for my forum moderation ( sending emails via flag actions to mods about flagged comments ).
Comment #8
benjifisherI applied the patch, but it does not solve my problem. I would like these tokens to be available when the nodecomment is created. The reason is that my nodecomment includes an ImageField, and I would like to use the title of the parent node as the default ALT text. (I figure that if the rest is working, I can figure out how to add a [node-comment-parent-title] token.)
Comment #9
benjifisherI solved my problem, but I do not know enough to do it right. Maybe someone else is willing to do a better job with this.
with
if(1) {. After this change, the new tokens actually work. As I said, I do not know enough to do this correctly.$tokens['node']['node-comment-parent-title'] = t('The title of the parent node.');to
nodecomment_token_list()andto
nodecomment_token_values(). (These functions are defined in the patch from Comment #7.) Success!I am a little afraid that
$parent->titleis not properly sanitized, but maybe that is handled when the page is displayed.Comment #10
IckZ commentedhey,
this works very well since I edit and save the node. If I do so, the pattern is not filled and in plaintext in the url.. Any Ideas how to fix this?
Comment #11
benjifisherPlease be more specific about what you did, what worked, and what did not work. For example, when you say, "this works very well," what does "this" mean?
Comment #16
YK85 commentedHello,
Would this feature help with #1071194: Rules Integration for nodecomments? At the moment it seems like it is not possible to reference the node which nodecomment is a comment of. Therefore, in my use case, I am unable to reward userpoints to the commented content's author.
Example:
nodecomment created >> give 5 userpoints to the author >> also give 1 userpoint to the commented content's author
Thank you very much
Comment #17
jasom commentedI dont know how to create patch so that im sending all code described and working in #9 and #7
Comment #19
YK85 commentedThanks!!
Comment #20
eidolon nightUsed #18 with the latest Pathauto 2.x and it looks like stuff is getting encoded... twice. Here's an example:
#comment -> %23comment -> %2523comment
Comment #21
aCCa commentedSee #16 -> With rules you can. Just Populate the node reference field after a nodecomment has been saved and return a php snippet like this one:
Comment #22
tbugert commented#21
I also need to react from a nodecomment with its Parent-Node. But I'm not sure, if I understand your tip. Where do i put the nodereference field: to the Parent node or to the comment node?
Comment #23
bkosborneJust putting my two cents in, I needed this functionality and I have it working.
I have product reviews as a node comment, and when a user submits one, I wanted the title of the review to be "Review: [product_name]". So I modified #17 a bit, created my own module for it, and have it working with automatic node title module.
Comment #24
sirkirya commentedI've got the node on which a nodecomment was made with help of this Custom tokens module. The settings for the newly created custom token are:
Token ID: token_custom_node_comment_target (or any other name ^_^)
Type: Node
PHP Replacement:
return $node -> comment_target_nid;Later I've used that token with Rules.
Sorry for my poor English skills.
And sorry for inappropriate issue settings.
Comment #25
userok commentedsubscribe
Comment #26
crea commentedFirst, this is not a bug, unless the token was implemented in the module from the start
Second, I don't see working patch - there are no success reports.
Comment #27
crea commented