Hello,

Theming Content Type (Product Display -> Yes) don't work. (node--contenttypename.tpl.php)

Bye

Comments

dudenhofer’s picture

Try using node--product--type.tpl.php - this can be copied from the profiles/commerce_kickstart/modules/commerce_kickstart/commerce_kickstart_product_ui/theme folder and copied to your theme. Then you could update it from there.

vasike’s picture

Version: 7.x-2.0-rc4 » 7.x-2.x-dev
Category: bug » support
Status: Active » Needs review

i can confirm #1 solution.
i copied the node--product--type.tpl.php in the Commerce kickstart theme templates folder.
and i could change the product display page

i think some documentation it's good to have.

gbrands’s picture

I have several product types that I needed to theme separately....here's what I did.

I created a new template suggestion in my custom theme:

/**
 * Override or insert variables into the node template.
 */
function robolawn_theme_preprocess_node(&$vars) {
  $product_display_types = commerce_product_reference_node_types();
  if (isset($vars['type']) && isset($product_display_types[$vars['node']->type])) {
    $vars['theme_hook_suggestions'][] = 'node__product__type__' . $vars['node']->type;
    $vars['classes_array'][] = 'node-product-type';
    if ($vars['view_mode'] == 'product_list') {
      $vars['theme_hook_suggestions'][] = 'node__product__type__product__list';
      $vars['classes_array'][] = 'node-product-type-product-list';
    }
  }
}

Now I can use the template naming convention: node--product--type--TYPENAME.tpl.php

Hope this helps someone. If this should be placed into documentation somewhere please let me know and I can move it. If it already is....it's really hard to find.

jsacksick’s picture

Status: Needs review » Fixed

Your hook_preprocess_node shouldn't be necessary as we already have one in our module.
See http://drupal.org/node/1911600#comment-7042468

gbrands’s picture

Thanks!

Status: Fixed » Closed (fixed)

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