Alaska wrote:Would this then

Posts: 54
Joined: 08/08/2007

Alaska wrote:
Would this then be correct?
Yes.

The problem is that in the default node.tpl.php the body of the node (including prices and images) is output as aggregated $content variable with its own markup. Now in order to do something beyond styling - like showing the list price only if it's higher than the sell price - you need to "break up the node body into pieces" and output them one by one, marked up to your liking, using some custom logic. You also need to take care of image output (which is unfortunate if you'd prefer to stick with the default).

Usually all this is done in a customized node.tpl.php (node-product.tpl.php for Übercart products) - what this tutorial is basically about Eye-wink (You could alternatively place that logic in a custom template.php in your theme to modify the $content variable, but that requires more advanced knowledge of PHP and Drupal.)

Nifty Products Tutorial Part 1 By: mykz- (81 replies) Wed, 03/19/2008 - 20:04