

<?php if (is_null(Mage::registry('blogId'))): ?>
    <?php echo Mage::helper('designer/messages')->error('Invalid blog id.') ?>
<?php else: ?>
    <?php $_buffer = Mage::getModel('designer/buffer') ?>

    <?php if ($_buffer->capture('header')): ?>
        <?php echo $this->__('Popular Search Terms') ?>
    <?php endif ?>

    <?php if ($_buffer->capture('content')): ?>
        <?php if( sizeof($this->getTerms()) > 0 ): ?>
            <ul class="tags-list">
                <?php foreach ($this->getTerms() as $_term): ?>
                    <li><a href="<?php echo $this->getSearchUrl($_term) ?>" style="font-size:<?php echo $_term->getRatio()*70+75 ?>%;"><?php echo $this->htmlEscape($_term->getName()) ?></a></li>
                <?php endforeach; ?>
            </ul>
        <?php else: ?>
            <?php echo Mage::helper('designer/messages')->notice($this->__('There are no search terms available.')) ?>
        <?php endif ?>
    <?php endif ?>

    <?php
        $_blogTpl = Mage::helper('designer')->createTemplate('blog', Mage::registry('blogId'));
        $_blogTpl->setArticles($_buffer->complete());
        echo $_blogTpl->toHtml();
    ?>
<?php endif ?>