I found a way to add a static block in a dropdown. I edited the renderer.phtml in page/html/topmenu and added:
$html .= '<ul class="level' . $childLevel . '">';
$html .= $this->_getHtml($child, $childrenWrapClass);
$staticBlock = trim($this->getLayout()->createBlock('cms/block')-
>setBlockId($child->getId())->toHtml());
if(!empty($staticBlock)){
$html .= '<span>';
$html .= $staticBlock;
$html .= '</span>';
}
$html .= '</ul>';
Now I want t show a different static block in every menu items dropdown. So based on the top category, a different static block should be called.
What would be the best way to do that?
The code I used is this:
staticBlock = trim($this->getLayout()->createBlock('cms/block')->setBlockId('top-5')->toHtml());
$html .= '<span class="nav-static-block">';
$html .= $staticBlock;
$html .= '</span>';
$html .= '</ul>';