For one of our projects, we've decided that it doesn't make sense to display the "Add Comment" link for teasers. To allow for this we've added an option in the TALK Admin Form to show/hide "Add Comment" links for teasers. I don't have the tools etc. to create a true patch so I've pasted the code below:

Change #1: add the following code to function talk_admin_form() after $form['talk_page_no_comments'] = array(..);

  $form['talk_addcmnt_teaser'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display the "Add Comments" link for teasers'),
    '#default_value' => variable_get('talk_addcmnt_teaser', TRUE),
    '#description' => t('If checked, then the "Add Comment" link will also be displayed for node teasers.'),
  );

Change #2: add the following to function talk_link() as new first line before if ($type == 'node' ...)

  $addcmnt = ((_talk_node_comment_value($node) == COMMENT_NODE_READ_WRITE) && (!$teaser || variable_get('talk_addcmnt_teaser', TRUE)));

Change #3: in function talk_link() change the line elseif (_talk_node_comment_value(...) ...) to

elseif ($addcmnt)

That's it!

I've attached my version of the talk.module file and you can see my changes marked "[ML-13APR2011]"

CommentFileSizeAuthor
talk.zip3.17 KBmlanser

Comments

jarodms’s picture

Assigned: Unassigned » jarodms
Status: Active » Needs review

Good addition! This is in DEV and ready for review.

jarodms’s picture

Status: Needs review » Closed (fixed)

Included in 6.x-1.7-rc1.