Hello,

I would like to ask if its possible to have two templates for one content type and select which one to use for specific node?

For example, I have node "review" and contemplate with code to display video field. Now, if I like modify a bit this template for different design, I need to create another content type and copy all the cck fields and than make a little change in contemplate. Is it possible to have multiple contemplates and select whichever one I like to use in different occasion for same node type?

Thank you

Comments

chazz’s picture

Status: Active » Needs review
Issue tags: +switch

I managed to do it with <?php if code to display either one or second template design, depend which cck field I like to display. Looks correct, but is it a god way of doing it regarding performance? Looks like 2 in 1 hack ;p

toddwshaffer’s picture

I'm no pro, but I've been utilizing Panels to get this type of functionality. When using panels you select the Node Type you want to modify, hand it the parameters in which you want the different template to render, and voila, you're done.

Granted, Panels may be a "heavier" solution but for that specific issue it works wonders.

FYI, I'm coming from a Panels addiction and trying to figure out if I can use ConTemplate to modify Panels templates :)

diseño web palma de Mallorca’s picture

chazz could you please tell my the code you used to make this? the if parameters you used?? Not a programer