Hi,
I use a function in my module which overrides a template (phptemplate_content_field).
But it should only do this for a special content type.
If the content type is one of the normal types like story, I would like to switch back to using the template to guarantee normal behavior.
The Problem is that I have no idea on how to get the template file output, once the corresponding function is called.
First I thought I might just cunstruct the template's output inside the function, but I can not access the variables added by the preprocess functions, can I? And it would be hard to even emulate the preprocess functions.
From what I understand this is not an trivial task. Is there a trick to do it?
Thanks in advance,
hama.
Comments
what exactly are you trying to accomplish?
are you trying to theme a specific cck field? I'm not exactly sure what you are trying to do.
Also, it always helps to post code
Yes, exactly. I override
Yes, exactly. I override cck/theme/content-field.tpl.php with my function. But it should only be themed for a special node type. Otherwise it should look as described in content-field.tpl.php.
My.module:
//EDIT: the theming I do can not be done via css
you don't need a module or a function
all you have to is create a template like this:
content-field-CONTENT_TYPE.tpl.php is used to theme all CCK field in that content type.
and that temple will be used to theme your field output only for your special content type, so if your content type is called article, then you would create
content-field-article.tpl.php is used to theme all CCK field in that content type.
you should read this blog post
http://hddigitalworks.com/theming-cck-content-type
Thank you very much. This is
Thank you very much. This is a great idea :D