0

Can anyone explain how to override theme_image() but only on a specific custom node template? (i.e. node--artist-page.tpl.php)

As I understand you shouldn't put things like theme_image() in a .tpl file, but the theme devel module it's not offering up any candidate function name overrides except mythemename_image(), which would apply to all images on all pages.

1 Answer 1

2

As I understood your problem, you need to redefine theme_image function only for custom template. I found following link for you that can help you to resolve your problem.

How to redefine default theme_image() function?

Another way is just override theme_image() function that you don't want to follow:

  1. Find the original theme function.
  2. Copy and paste it into your template.php file.
  3. Change the beginning of the function name from theme_ to yourthemename_.
  4. Save template.php, clear the site cache, and reload!

Keep us posted with what you figure out.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.