Contemplate Templates
| Project: | Content Templates (Contemplate) |
| Version: | 5.x-2.01 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Hi.
Sorry if this sounds a bit incoherent, I've been hacking drupal for the last 14 hours straight.
I've been working with Contemplate, after struggling for over 2 days just to get it right and I came up with the following idea.
First, you can alter/add code to the tpl files, but that's a bit of a mission for a newbie, as I discovered. However, on my test platform, I discovered it was easier to write a .contemplate file, so that I could have say, audio.node.contemplate and audio.teaser.contemplate and even audio.rss.contemplate. This are currently located in sites/all/contemplates folder. Also within the contemplates folder, I have a separate folder called css that houses the css file(s) and I have linked that to node.tpl. Right. Now in the actual contemplate/node type part, I invoke it by simply putting in include_once 'audio..contemplate. The contemplate file has all the fields and content. It worked flawlessly. Shouldn't this be a standard feature for contemplate and we have different contemplate files as sort of theme files? So that whoever wants a specific layout can simply just upload a contemplate file, and have a standard invoke.
Or we should create an entire project to manage this.
Just a thought.

#1
this is lines 43 to 60 of README.txt
"Disk-based templates
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.
Place these files into a directory called "contemplates" inside of either your
"sites/all" directory or "sites/{yoursite}" depending on your setup. It is also
possible to have multiple "contemplate" directories with
"sites/all/contemplates" being the fallback for templates the contemplate does
not find in the more specific site directory.
When adding or removing template files, you will need to visit the Content
Templates admin page to refresh the template list cache. You do not need to do
this again when making changes to the content of the templates."
#2
this functionality was added in 5.x-1.5
#3
I agree with you both. What I mean to say is the ability to distribute say a .contemplate file which already has the fields predefined, so that others can use them. Similar to what we have with themes. I know about the disk based templates, I am just looking at ways of extending it to make it easier for others to set up. I'm pretty much exploring distributing contemplate templates for others to use.
#4
When I said I agree with you both, I meant I was discussing this on IM with another Drupal buddy. I haven't gone bonkers.
#5
I was wondering about the bonkers thing.
#6
Gone to back burner....