Hello everyone.

I have a theme highly related with a module.

Now, I'm having this issue:

I've included a file with some functions in my custom module; adding the line "files[]" in the module.info

I wanna call these functions within my theme's templates.

But I can't... except if I include the especific file using module_load_include. (In this case, it works)

NOW, I REALIZE THAT EVEN IN MY MODULE FILE, THE FUNCTION ISN'T AVAILABLE.

why the functions aren't available in my theme AND MY MODULE? after all, the file IS INCLUDED ALREADY in the module. What I'm missing?

what is the point of add inc files in the info file if then functions in it aren't available?

What is the Drupal way to accomplish this? I meant, call custom module functions within my theme templates (without using module_load_include)

Thanks

Comments

Augusto182’s picture

Title: Call module function within theme template » Call functions from inc file in other modules and themes (without using module_load_include)
Issue summary: View changes

Version: 7.37 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.