[themes] Overriding zone etc. templates for specific content types in D7

Info Razor inforazor at gmail.com
Sun Mar 3 16:38:58 UTC 2013


if it doesn't pick it up, have you cleared your theme-cache?

otherwise for the zones, you may indeed need to do stuff in the template.php instead. Do you use other debugging tools like devel + dpm()?

if you are trying to preprocess the zone area in only certain conditions I would say you either need to copy the zone file over and add some PHP to it, or work with preprocessors in the template.php.

The alpha/omega theme come with many template files in their theme, if you copy those to your theme you can then override them.

instead of creating a zone-template you sometimes can do the same using the module "delta" and configuring the theme to work differently on a different page. i don't know what you are trying to achieve, but often there is more than one-way to do things in Drupal.

good luck! 

-- 
Info Razor
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Sunday, March 3, 2013 at 8:31 AM, Jeff Greenberg wrote:

> Arrgh. So I found several references to, and created a template called node--product-display.tpl.php. It's in my themes's template directory with the other templates in use, and I did clear cache. 
> 
> When I load the page and click on the product area, with theme developer running, it gives me this for the theme candidates:
> node--product--type.tpl.php < node--23.tpl.php < node--product-display.tpl.php < node.tpl.php
> 
> Yet, anything I put in the template file is ignored, including exit;
> 
> 
> On Sun, Mar 3, 2013 at 9:47 AM, Jeff Greenberg <jeff at ayendesigns.com (mailto:jeff at ayendesigns.com)> wrote:
> > Yes, Omega. A zone is like a superset of a region. So what I want to do is have a template that controls a zone for only a specific content type. I suspect I'll need to peruse the Omega template.php file
> > 
> > --
> > In the top 10% viewed LinkedIn profiles for 2012
> > --
> > 404-271-9734 (tel:404-271-9734)
> > Sent from my iPhone. Any typos are the result of my oversized fingers or Siri not being able to comprehend my dialect.
> > 
> > 
> > On Mar 3, 2013, at 12:32 AM, Info Razor <inforazor at gmail.com (mailto:inforazor at gmail.com)> wrote:
> > 
> > > Hi Jeff,
> > > 
> > > Not sure what you mean by "zone template" (referring to Omega theme maybe?) but if all you want to do is to make a template for a Node, the format is: 
> > > 
> > > node-{NAME}.tpl.php
> > > 
> > > where {NAME} is the *machine* name for your content type.
> > > 
> > > You can also find out the template suggested names by using the module devel_themer, and then clicking on the content type you are interested in. It will suggest functions in template.php and/or template names you can use, based on what you select. 
> > > 
> > > make sure to turn off devel_themer after you need it though cause it does mess up other regular stuff (its a bit of a hog-bug)
> > > 
> > > there are other techniques to engineer the template names, but this should get you started. 
> > > 
> > > Good luck!
> > > 
> > > rgds,
> > > 
> > > datarazor 
> > > 
> > > -- 
> > > Info Razor
> > > Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
> > > 
> > > 
> > > On Saturday, March 2, 2013 at 9:20 PM, Jeff Greenberg wrote:
> > > 
> > > > Is there a template hint for overriding a zone template for a specific content type, such as a content zone template for product display, or do I need to create one in template.php? 
> > > > 
> > > > -- 
> > > > ---
> > > > drupal.org/user/367108 (http://drupal.org/user/367108)
> > > > linkedin.com/in/jeffrgreenberg (http://linkedin.com/in/jeffrgreenberg)
> > > > accidentalcoder.com (http://accidentalcoder.com) / ayendesigns.com (http://ayendesigns.com)
> > > > @accidentalcoder
> > > > 
> > > > 
> > > > 
> > > > _______________________________________________
> > > > themes mailing list
> > > > themes at drupal.org (mailto:themes at drupal.org)
> > > > http://lists.drupal.org/mailman/listinfo/themes
> > > > 
> > > > 
> > > > 
> > > 
> > > 
> > > _______________________________________________
> > > themes mailing list
> > > themes at drupal.org (mailto:themes at drupal.org)
> > > http://lists.drupal.org/mailman/listinfo/themes
> > 
> > _______________________________________________
> > themes mailing list
> > themes at drupal.org (mailto:themes at drupal.org)
> > http://lists.drupal.org/mailman/listinfo/themes
> > 
> 
> 
> 
> -- 
> ---
> drupal.org/user/367108 (http://drupal.org/user/367108)
> linkedin.com/in/jeffrgreenberg (http://linkedin.com/in/jeffrgreenberg)
> accidentalcoder.com (http://accidentalcoder.com) / ayendesigns.com (http://ayendesigns.com)
> @accidentalcoder
> 
> 
> _______________________________________________
> themes mailing list
> themes at drupal.org (mailto:themes at drupal.org)
> http://lists.drupal.org/mailman/listinfo/themes
> 
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/themes/attachments/20130303/5a1e0552/attachment-0001.html 


More information about the themes mailing list