_preprocess_ issues

View: New views
3 Messages — Rating Filter:   Alert me  

_preprocess_ issues

by Matt Funk-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi,


I tried the support forum first, but no one seems to answer there, so forgive
me if this is thread is misplaced.


I am trying a simple thing:
I declare (straight from pro drupal development):


function phptemplate_preprocess_breadcrumb(&$variables) {
drupal_set_message(print_r("some message,true));
}


After clearing the cache, i also check the theme-registry (via the developer
module) and it is listed under breadcrumb->phptemplate_preprocess_breadcrumb


as:
2 (String, 33 characters ) phptemplate_preprocess_breadcrumb | (Callback)
phptemplate_preprocess_breadcrumb();


However, it is NEVER called as far as i can tell. Variables set in there are
always empty and message set as shown above never show either.


I am sorry to bother the list with this, but WHAT am i doing wrong?



thanks
matt


Re: _preprocess_ issues

by John VanDyk :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Matt, take a look at the Note on page 182: "Variables are only aggregated and passed into themable items that are implemented as template files. Variables are not passed into themable items implemented as theme functions."

Thus, if you do not have a breadcrumb.tpl.php file in your theme, that is why it is not happening for you.

Also, the Note on page 181 warns: "Don't use Garland as the active theme..."

If you do use Garland, you'll have to comment out the phptemplate_breadcrumb() function in Garland's template.php, as it is taking precedence.

John

On Oct 30, 2009, at 5:56 PM, Matt Funk wrote:

Hi,

I tried the support forum first, but no one seems to answer there, so forgive 
me if this is thread is misplaced.

I am trying a simple thing:
I declare (straight from pro drupal development):

function phptemplate_preprocess_breadcrumb(&$variables) {
drupal_set_message(print_r("some message,true));
}

After clearing the cache, i also check the theme-registry (via the developer 
module) and it is listed under breadcrumb->phptemplate_preprocess_breadcrumb

as:
2 (String, 33 characters ) phptemplate_preprocess_breadcrumb | (Callback) 
phptemplate_preprocess_breadcrumb(); 

However, it is NEVER called as far as i can tell. Variables set in there are 
always empty and message set as shown above never show either.

I am sorry to bother the list with this, but WHAT am i doing wrong?


thanks
matt


Re: _preprocess_ issues

by Matt Funk-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Thank you John,


i am sorry. I wasn't trying to be dense on purpose.
Things work now ...


matt


On Saturday 31 October 2009, John VanDyk wrote:
> Matt, take a look at the Note on page 182: "Variables are only
> aggregated and passed into themable items that are implemented as
> template files. Variables are not passed into themable items
> implemented as theme functions."
>
> Thus, if you do not have a breadcrumb.tpl.php file in your theme, that
> is why it is not happening for you.
>
> Also, the Note on page 181 warns: "Don't use Garland as the active
> theme..."
>
> If you do use Garland, you'll have to comment out the
> phptemplate_breadcrumb() function in Garland's template.php, as it is
> taking precedence.
>
> John
>
> On Oct 30, 2009, at 5:56 PM, Matt Funk wrote:
> > Hi,
> >
> > I tried the support forum first, but no one seems to answer there,
> > so forgive
> > me if this is thread is misplaced.
> >
> > I am trying a simple thing:
> > I declare (straight from pro drupal development):
> >
> > function phptemplate_preprocess_breadcrumb(&$variables) {
> > drupal_set_message(print_r("some message,true));
> > }
> >
> > After clearing the cache, i also check the theme-registry (via the
> > developer
> > module) and it is listed under breadcrumb-
> >
> > >phptemplate_preprocess_breadcrumb
> >
> > as:
> > 2 (String, 33 characters ) phptemplate_preprocess_breadcrumb |
> > (Callback)
> > phptemplate_preprocess_breadcrumb();
> >
> > However, it is NEVER called as far as i can tell. Variables set in
> > there are
> > always empty and message set as shown above never show either.
> >
> > I am sorry to bother the list with this, but WHAT am i doing wrong?
> >
> >
> > thanks
> > matt