Trying to theme CCK content types, i noticed that Userreview submission form (activated for my content types) does not show when:

1) Activating the Content Template module (aka Contemplate)
2) using a node-content-mytype.tpl.php file in theme folder

Leaving CCK only, userreview submission form is there where it should be at bottom of nodes. When activating Contemplate or copying a php theme file to the theme folder, it vanishes...

anyone else experiencing this? Is there a quick way to fix?

thx

Comments

hedac’s picture

I have the same problem... don't know how to fix it

marcoBauli’s picture

seems that each contributed module needs first to pass it's variables to Contemplate in order to make it output all the desired contents.

Have a look at http://drupal.org/node/83829 at #5 for a quick explanation about how to do this, and eventually please submit a patch.

I tryed with other modules and that method worked, but Userreview is a bit more complicated to sort out...

hedac’s picture

Hi... I got it working
Try this in your template of contemplate. I didn't need to add anything in the userreview.module

<?php 
print $userreview->review_form;
?>

it seems to add the write your review form. and it works.... I add a review and it is there in the content nodes and in the frontpage... but I can't see the review in the page view node itself....

marcoBauli’s picture

yes, that's the problem... i got the form too, but didn't manage to output well the medium vote as well as the reviews..

since i needed something quick, i moved to core comments and Voting module widget combo.

Hope this will get fixed anyhow,

good luck!

chriszz’s picture

You can find out that kind of information by doing this:

print_r($userreview);

Than you will know, that you can achive what you asked for with this:

$userreview->review_list:
$userreview->current_user_review;
$userreview->review_form;

regards
Christian

nilamr’s picture

Hi Christian,

Can you be more specific please. Where do I add the statements you mentioned - in template created by contemplate?

thanks for your help
nilam

gerd riesselmann’s picture

Status: Active » Fixed

The userreview does already what's mentioned in http://drupal.org/node/83829 at #5, so I think the bug can be marked as fixed.

The properties of relevance are:

  • $node->userreview->average_vote: The average vote (like "6.5 out of ten based on 7 votes")
  • $node->userreview->current_user_review: The current logged in user's review, if any
  • $node->userreview->review_form: The form to submit a review. Empty if user is not logged in or has already submitted a review
  • $node->userreview->review_list: A list of all recent reviews

Print or echo the properties you want to be displayed in your contemplate template.

chriszz’s picture

You can add the statments in any kind of template - like contemplate - or phptemplate... I am using it within a phptemplate, as i found, that contemplate was restricting me to much.

regards
Christian

Anonymous’s picture

Status: Fixed » Closed (fixed)