2 replies [Last post]
RidolfiDesigns's picture
Offline
Joined: 03/31/2009
Juice: 5
Was this information Helpful?

I was wondering how you would theme the product page? I am not talking about the product node. I already found that article. I want to change the layout of the page the product node sits in. How would I go about doing that?

I tried page-product.tpl.php and I tried product.tpl.php. None of them worked. I am not sure what to do.

Thanks

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Easy Question about Themeing

Page templates don't get as many fun template possibilities by default. Drupal lets you make page-front.tpl.php and anything else based on the path (e.g.: page-node-4.tpl.php, page-admin-store-orders.tpl.php, etc.). However, you can add to the template suggestions with hook_preprocess_page(). You can implement this hook in your theme's template.php file or in your site's custom module. Take a look at uc_product_preprocess_node() to see how it adds node-product.tpl.php to the list of the node templates for products. template_preprocess_page() and template_preprocess_node() in theme.inc also do a lot of neat things.

Danny_Joris's picture
Offline
Joined: 05/09/2009
Juice: 199
Re: Re: Easy Question about Themeing

Hey Lyle, i have the same problem. I made the node-product.tpl.php and cleared cache as suggested here: http://www.ubercart.org/forum/development/3868/nifty_products_tutorial_p... but it does not work.

What do you mean with 'looking at uc_product_preprocess_node()' ? Where do i find it? I have the feeling that i'm missing important information to make this work.

-- EDIT: Fixed !!!
http://www.ubercart.org/forum/development/3868/nifty_products_tutorial_p...