2

Have the following code

    $links = array_merge($links, array(
      l(t('Administration pages'), 'admin'),
      l(t('Front page'), '<front>'),
     ));
    }

    $output = theme('item_list', array('items' => $links, 'title' => t('Next steps')));

It does <ul> html list. My goal is to override, for example, "admin" path on given page from my custom module. Since it's themed output, I can use hook_theme_registry_alter() to override the theme function. But seems I can't do that dynamically (because of cache).

Is it wise solution to copy whole theme_item_list function, rename it to my_theme_item_list and write there my own path logic?

Another solution?

1

I think you can do anything you could do in my_theme_item_list in a preprocess function. You can do this in your template.php file with a function like:

function mythemename_preprocess_item_list(&$vars) {
  // Change things here
}
|improve this answer|||||

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.