I want to overwrite [page-title] from a custom module I've made, I've tried

$tokens['page-title'] = $my_var;

I think it isn't working due to the use of array_merge on line 266 of token.module.

$all = array_merge($tokens['global']['default'], $tokens[$type][$id]);

There's a reference to $options array in API.txt but no details of usage, can $options help me? Is there another ways to set [page-title] programatically?

Comments

j0hn-smith’s picture

I'm trying to overwrite in [page-title] in 'node' scope.

j0hn-smith’s picture

Status: Active » Closed (fixed)

I think this is caused by the use of array_merge_recursive in module_invoke_all. I guess I'm trying to do something that I shouldn't be trying to do.