shopp('product.tag')

Displays the current tag name in a shopp('product.tags') loop.

shopp('product.tag', 'options')

@param string $object the object or object.tag combination, if object.tag is used, the tag parameter can be omitted
@param string $tag the tag, can be hyphenated or not. Prefix with 'get' as shorthand for the return=true option
@param mixed $options associative array, or url-style name=value pairs separated by ampersands (&). Each pair is passed to the theme api tag as an option.
@returns string The name of the current tag.

Displays the current tag name. The default return with no options is the name of the current tag. This Theme API tag is typically used within a shopp('product.tags') loop.

Options

  • show: value of id returns the id of the current tag

Examples

<?php shopp('product','tag'); ?>

Display a list of tags

<?php if(shopp('product','has-tags')): ?>
    <ul>
    <?php while(shopp('product','tags')): ?>
        <li><?php shopp('product','tag'); ?></li>
    <?php endwhile; ?>
    </ul>
<?php endif; ?>

Display a list of tag IDs

<?php if(shopp('product','has-tags')): ?>
    <ul>
    <?php while(shopp('product','tags')): ?>
        <li><?php shopp('product','tag','show=id'); ?></li>
    <?php endwhile; ?>
    </ul>
<?php endif; ?>

See Also

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.

Skip to toolbar