0

I am developing a site using Ubercart that shows product summaries on the main page (I believe these are called teasers). Each product has a voting widget provided by Vote Up/Down on its actual node/page. I've copied page.tpl.php to page-front.tpl.php because I want to add a small block or box that shows the number of upvotes on the main page (but not actually allow voting here) and finally sort these teasers by popularity (number of votes).

I can see that print $content is outputting this page's content but I am not sure where this is being generated so I can either hook into it or modify directly. I've coded themes and plugins in Wordpress but I don't know Drupal well enough yet.

Thanks in advance.

xst
  • 2,536
  • 5
  • 29
  • 41

1 Answers1

1

You should first know what is generating your front-page. Is it Views? Or another module?

If it's Views, you can easily add the vote count from the Drupal backend. If it's another thing, depending on what it is there are ways to change the output.

  • i'm not sure what is generating the front-page other than that page-front.tpl.php is used to format it. i only have ubercart installed (and other modules unrelated to the front page)and the settings are all default – xst Dec 03 '12 at 04:22
  • Under "Views" settings for the front page. changing row style or any options here seems to have no effect – xst Dec 03 '12 at 04:42
  • If you go to Config > System > Site Information and see the default front page, do you see `node`? If yes, then what you can do is enable the Views front-page on Structure > Views > Front page > Enable. And then you can edit that Views, on the `Fields` section you can add the Vote Count. – Pria Purnama Dec 03 '12 at 05:19
  • I'm using Drupal 6. What I am trying now is to generate a [Computed Field](http://drupal.org/project/computed_field) and then sort on that – xst Dec 03 '12 at 05:57
  • I'm not sure if you can use `Computed Field` on the Views sort field, you can try that. If that doesn't work, you can use the `Vote Up/Down` field to sort, but to do that first you have to add it on the Relationships. It should be shown as `Node Vote Up/Down` or something like that. – Pria Purnama Dec 03 '12 at 07:57