the current "updown" display combines +/- buttons and votes counter, which is good for full nodes. However I think it would make sense to optionally have the counter only (without +/-) on teasers, so that users don't vote without even seeing the full story.

Comments

lut4rp’s picture

The updown theme included in the official download will not work like this, but its fairly easy to make duplicate the updown theme, rename it and slightly mod its design as per your needs.

marvil07’s picture

+1
IMHO this could be a frequent feature.

I was trying to make a conditional theming, but the actual variables passed to widget.tpl.php does not include such a variable.

A get_defined_vars() gave me:

array
  'template_file' => string 'sites/all/modules/vote_up_down/widgets/updown/widget.tpl.php' (length=60)
  'variables' => 
    array
      'cid' => string '38' (length=2)
      'type' => string 'node' (length=4)
      'widget_theme' => string 'updown' (length=6)
      'tag' => string 'vote' (length=4)
      'class_up' => string 'up-inactive' (length=11)
      'class_down' => string 'down-active' (length=11)
      'link_up' => string '/vote/node/38/1/vote/22f85aca08ec337974cdcc65e00305f3' (length=53)
      'link_down' => string '/vote/node/38/-1/vote/4093c96b677a958f7e881abbafaf67c9' (length=54)
      'unsigned_points' => int -1
      'points' => int -1
      'class' => string 'negative' (length=8)
      'vote_label' => string 'votes' (length=5)
  'cid' => string '38' (length=2)
  'type' => string 'node' (length=4)
  'widget_theme' => string 'updown' (length=6)
  'tag' => string 'vote' (length=4)
  'class_up' => string 'up-inactive' (length=11)
  'class_down' => string 'down-active' (length=11)
  'link_up' => string '/vote/node/38/1/vote/22f85aca08ec337974cdcc65e00305f3' (length=53)
  'link_down' => string '/vote/node/38/-1/vote/4093c96b677a958f7e881abbafaf67c9' (length=54)
  'unsigned_points' => int -1
  'points' => int -1
  'class' => string 'negative' (length=8)
  'vote_label' => string 'votes' (length=5)

So, where should I add a $is_teaservariable ?

marvil07’s picture

Status: Active » Fixed

this is fixed by #670146: display voting widget even if user doesn't have permission to vote?

now you have a $readonly variable on widget.tpl.php's

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.