<?php if ($field->isPartial()): ?>
  <?php include_partial('cat/'.$name, array('form' => $form, 'attributes' => $attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes)) ?>
<?php elseif ($field->isComponent()): ?>
  <?php include_component('cat', $name, array('form' => $form, 'attributes' => $attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes)) ?>
<?php else: ?>
  <div class="<?php echo $class ?><?php $form[$name]->hasError() and print ' errors' ?>">
    <div>
      <?php $opts = $form[$name]->getWidget()->getOptions(); ?>
      <?php if (key_exists('type', $opts) && $opts['type'] == 'checkbox'): ?>
        <div class="content"><label><?php echo $form[$name]->render($attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes); ?><?php echo $label; ?></label></div>
      <?php else: ?>
        <span class="inline-label"><?php echo $form[$name]->renderLabel($label) ?></span>
        <div class="content">
          <?php echo $name == 'alias' ? 'catalog/' : ''; ?>
          <?php echo $form[$name]->render($attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes) ?>
          <?php echo $name == 'alias' ? '/' : ''; ?>

            <?php echo $form[$name]->renderError() ?>
          <?php if ($help): ?><span class="help"><?php echo __($help, array(), 'messages') ?></span><?php elseif ($help = $form[$name]->renderHelp()): ?><span class="help"><?php echo strip_tags($help, '<a><i>') ?></span><?php endif; ?>
        </div>
      <?php endif; ?>
    </div>
  </div>
<?php endif; ?>
