Closed (fixed)
Project:
Content Templates (Contemplate)
Version:
6.x-0.8
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 May 2008 at 08:36 UTC
Updated:
4 May 2008 at 13:51 UTC
Hello.
What's the simplest way to accossiate css files with a disk based template. So that all content that is based on the template automatically links to the css files and no other content.
Thanks.
Comments
Comment #1
dman commentedWhat is a "disk based template" ?
Comment #2
Ferm-1 commentedIts a php file that defines the template
"It is also possible to create disk-based template files. To do this, copy the contents of a contemplate textarea and paste it into a file called "node-nodetype-field.tpl.php" where nodetype is the content type and field is either "body", "teaser", or "rss". It is also possible to create a template called "node-nodetype.tpl.php" which will affect all cases, and "node.tpl.php" which will affect all node types."
Comment #3
dman commentedOh.
Otherwise known as "template files" :-)
Well, the smartest way may be to place a call to
In the top of your customview.tpl.php. I do that when adding css that's specific to custom blocks.
You still have to have the right selectors in the CSS, but the css won't be included unless the theme function was actually invoked on the page you are looking at.
drupal_add_css will ensure the call doesn't double-up or anything if called more than once.
Is that the answer you wanted?
Comment #4
Ferm-1 commentedPerfect! Thank you very much.
Ok template file, I just used the term as written in the Content Templates Module help.
Comment #5
jrglasgow commented