Reageer op reactie

My problem was I didnt want php code in my views footer. But I still needed to check if a module existed to call a function of that module.
Here is the hook_views_pre_render, what happens in the function is :
- checking for the correct view and adding content to the footer
- setting the filter format which is the full html id
- setting the empty option

With this function not only the footer could be altered but the entire view could be altered since the views object is present.

<?php
/**
 * Implementation of hook_views_pre_render()
 */
function wishlist_views_pre_render(&$view) {
  if(
$view->name == 'wishlist') {
    if (
module_exists('orderlist')) {
      
$view->display_handler->set_option('footer'orderlist_admin_settings());
      
$view->display_handler->set_option('footer_format''2');
      
$view->display_handler->set_option('footer_empty'0);
    }
  }
}
?>

For more http://drupalcontrib.org/api/function/hook_views_pre_render/6

Reageren

De inhoud van dit veld is privé en zal niet openbaar worden gemaakt.
  • Toegelaten HTML-tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd><img><p><b><i><table><th><tr><td><blockquote><br /><img /><tbody><span><strike>
  • Regels en paragrafen worden automatisch gesplitst.
  • You can enable syntax highlighting of source code with the following tags: <codes>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo].
  • Adressen van webpagina's en e-mailadressen worden automatisch naar links omgezet.

Meer informatie over formaatmogelijkheden

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.