Community & Support

submenu's, rotating banners (og / conditional blocks),

Hey community,

i'm building my "first" drupal site and have a couple of questions.

env: drupal 6.13 / zen theme / og / signwriter / menuwriter block / a lot more...

Submenu:

I made a couple of menu's (one using the menu the signwriter - menuwriter block) and some have submenu items (no taxonomy used). Now i want something quite ordinary... Hide the subitems when the parent item isn't active. I thought that would be the normal behaviour but it isn't.

Conditional blocks (og) ???

I'not sure if my heading is right but can i use conditional blocks for those two issues:

1.) I want a different banner per organic group. How can i do that? And how can the og admin choose that image?
2.) And i want an own menu for each organic group. I installed og_menu but how to implement? (i don't wan't 50 menu's on a page)

regards Volkan

Comments

Any solution to the different banner per OG?

Hi Volkan

I also need the same feature for our site. Have you figured how to do it?
Would really appreciate a brief of all the research that you may have done on this.

Regards
Shekhar

different banner per OG

Hey... It's not really an easy solution when you are new to drupal. You have to add an image field to the group content type. After that you have create a pre_process function in your template.php like this:

function THEMENAME_preprocess_page(&$vars, $hook) {
  // is an OG post?
  $og_groups = $vars[node]->og_groups;
  if (is_array($og_groups)){
    foreach ($og_groups as $value){
      $noderefnode = node_load($field_lien_fiche[0][$value]);
      $refnode= node_load($value);
    }  
      // get custom banner
      if ($refnode->field_banner[0]['filepath']!=''){
        $vars['banner']="background:url(/".$refnode->field_banner[0]['filepath'].") 70px 0px no-repeat";
      }  
  //Is een OG group page
  }else{
   
    if ($vars[node]->field_banner[0]['filepath']!=''){
      $vars['banner']="background:url(/".$vars[node]->field_banner[0]['filepath'].") 70px 0px no-repeat";
    }  
  }

}

Now there is $banner available in your template files.

nobody click here