Confused about theme function calls.
Posted
by Nick Lowman
on Stack Overflow
See other posts from Stack Overflow
or by Nick Lowman
Published on 2010-04-12T21:20:13Z
Indexed on
2010/04/12
21:22 UTC
Read the original article
Hit count: 187
I've created a content type that has a CCK text field.
When I select the text field using the Drupal Themer widget it tells me the last function called was
theme_text_formatter_default()
, which I found in the CCK text.module
It also tells me that it's parents were;
content-field.tpl.php < theme_markup < theme_markup < node.tpl.php < page.tpl.php
So I assumed that somewhere in the content-field.tpl.php
was the function call to theme('text_formatter_default',$element)
but it wasn't in there. Just print $item['view']
used to display the content.
I searched all the project files for theme('text_formatter_default',$element)
and it doesn't exist. I know it's being called by the theme
function as I override it in my template.php
and it used my overridden function, which would only happen if was using the theme_hook$. Wouldn't it?
So how is it being called? It's not that I need to override it. I'm just learning how drupal works and thought I had it sussed until this. Something must be calling it.
Also, the function theme_text_formatter_default
exists in the theme registry and it's overridable (if that's a word) as I did so in my template.php and it displayed. It's all quite confusing.
Any help would be much appreciated
© Stack Overflow or respective owner