It would be nice if there was a module hook for setting template variables. Currently while you can write a module that provides theming options to nodes and blocks, you need to add/modify templates.php if you want to make those new values available as variables to the template (node.tpl.php, page.tpl.php etc.). It would be handy if there was a hook for template variables could be set from the module meaning users would not need modify their templates.php file.

Comments

magico’s picture

Version: 4.7.0 » x.y.z

+1

bradlis7’s picture

Title: Extending the ability to add variables » Module Hook for Adding Theme Variables
Version: x.y.z » 6.x-dev
Component: theme system » base system

Just wondering, what's something this might be used for?

bradlis7’s picture

Well, I'm guessing it has to do with NiftyCorners... a module to adjust a theme from what the name says.

Hm, it seems like this would be better as a snippet in the handbook than as a module... but I'm not for sure on that. If so, there wouldn't be a need for this. That's my $.02.

nevets’s picture

There have been no shortage of posts along the lines "I would like to hide X when displaying this node (or maybe page)". X might be something like the left or right column, the footer, header, etc. It is easy enough with form API to allow the user to make this choices and while one can embed setting values in the theme withh function calls, it would be nice to do be able to do this through a hook or maybe call to a theme function.

pasqualle’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.