Hi all,

I've got a node type of "blog" where I wanted to edit the output by adding a custom function to trim some of the text-variables in the node.

I added the function to template.php and applied it in the content template. The function is working alright but now I can't access the template at all, I get this error:

Fatal error: Call to undefined function drupalicious_summarise() in /var/www/www.danskdynamit.com/www/modules/contemplate/contemplate.module(851) : eval()'d code on line 4

The function used is seen here (very last post): http://drupal.org/node/46391#comment-789717

As I trimmed all text down to 10 words it's rather important to stupid me that I fix this error. Anyway to revert back, add the function another place or a smart way of removing the function or?

Thanks a lot, please do ask if there's anything more I need to elaborate.
Oskar

Comments

imrook’s picture

The example at http://drupal.org/node/46391#comment-789717 assumes you are editing templates on the filesystem. Your error message shows you're using the contemplate module to manage your templates. My guess is that your theme's template.php hasn't been included at the point of execution when contemplate tries to render the nodes. I quit using contemplate myself because it just caused more problems than it solved for me. But if you want to continue to use it, you'll need to get your drupaliciouse_summarise() function included before it gets called. Putting that function directly in the contemplate module show work. A more attractive option would be to create a new module that provides that function.

brewthis’s picture

Thank you very much. It worked out perfectly!

alienresident’s picture

Another solution is to include the path to the theme's template.php

<?php include_once 'sites/all/themes/your_theme_name/template.php'; ?> 

This work for me.