Contemplate messed up product page

Posts: 48
Joined: 01/31/2008

I tried to use contemplate for product content type and it basically blew it up (I tried reset already). Now the edit template page (and frontend) only has a white page with text Image, Price and nothing else. Is there a way to get the page back or will I need to reinstall?

Why does contemplate only see the image fields and what's the easiest way to customize the look of the product page without using contemplate?

Thanks!

Posts: 2008
Joined: 08/07/2007
AdministratoreLiTe!

The traditional way is to create a template file for products: node-product.tpl.php. This goes in your theme folder along with all the others. Start with a copy of node.tpl.php and modify it. If you're using product classes, you can use the class name instead of "product" for those node types.

To fix your edit page, try completely uninstalling Contemplate on the modules page. Hopefully that deletes all the files and changes it has made.

Posts: 48
Joined: 01/31/2008

I was able to get the page back by changing contemplate "flags" in DB. When I use node-product.tpl.php method, it also produces a white page with the content only - no header footer menu etc...

Posts: 2008
Joined: 08/07/2007
AdministratoreLiTe!

What are you trying to change it to? I imagine there's an error in the PHP syntax, and Drupal won't be able to handle those errors.

Posts: 48
Joined: 01/31/2008

Thanks again, I took out the following and it worked:

<?php
print $node->sell_price[0]['view']
?>

Posts: 2008
Joined: 08/07/2007
AdministratoreLiTe!

I can't tell if it doesn't work because you don't have a semi-colon, or that you should use just $node->sell_price.

You can put

<?php
  drupal_set_message
('<pre>'. print_r($node, true) .'</pre>');
?>

to see a good structured view of the $node object.

Posts: 48
Joined: 01/31/2008

Using just $node->sell_price works. Thank you so much, I was having a hard time understanding what to use especially for image arrays and all, but I get it now!!!

OOPS: how do you display attributes?

Posts: 2008
Joined: 08/07/2007
AdministratoreLiTe!

Attributes are part of the form with the Add to cart button. Try

<?php
 
print drupal_render($node->content['add_to_cart']);
?>