0

I am extending a module, I want to create a new theme function for the output but it somehow is not recognized. I know of theme registry and rebuild it (manually and via devel module)

The issue is tracked down to

function cmis_browser_content_properties() {
    $output = theme('cmis_browser_content_properties', array('cmis_object' => $object));
    debug($output, 'output');
    return $output;
}


function theme_cmis_browser_content_properties($variables) {
  // do sth
  $output = 'sth';
  return $output;
}

When I create a new function by copying the existing to

function theme_cmis_browser_content_propertiesnewtest($variables) 

and call it in above module code. There is no output anymore, debug says: ''

$output = theme('cmis_browser_content_propertiesnewtest', array('cmis_object' => $object));

Please enlighten me!

just fyi the cmis module is a connector to alfresco document repository via CMIS http://drupal.org/project/cmis

just seeing similar questions suggested. Will see if one fits, but send this anyaway.

2

From the looks of it you've forgotten to register your theme function with the system using hook_theme()

function MYMODULE_theme($existing, $type, $theme, $path) {
  return array(
    'cmis_browser_content_propertiesnewtest' => array(
      'variables' => array('cmis_object' => NULL)
    )
  );
}

After you clear the caches your theme function should be registered with the system and start working as expected.

  • okay that hook implementation was existing in the main module file. So I added my function – groovehunter Jan 4 '13 at 11:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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