PHP Template Function: StdCatImage
Posted by Mark [Elevated X Support] on 22 April 2015 12:05 PM

Description:

This will print an image for a specific set that is passed to it.

Common Location:

/cms_admin/phptemplate/<templatefolder>/functions/standard.tpl

Usage:

<?php foreach ($tags as $tag) { ?>

<?php StdCatImage(array("category" => $tag, "usepriority" => "34", "alt" => "", "class" => "update_thumb thumbs")); ?>

<?php } ?>

Arguments

There is only one argument that is passed to StdCatImage(), however, it is an associative array with the following possible elements:

category: This is an array containing all of the metadata for a category (which comes from the CMS)
usepriority: These are a list of thumbnail slots that the function should look for and use, separated by commas.
If multiple priorities are listed, use the first priority within the image, and use subsequent priorities as rollover images.
alt: This is the alt tag that should show on the image.
class: These are the CSS classes that will apply to the image.

Output

Here's an example of the output this function will do:

<img src="/members_php/content//contentthumbs/7-cat.jpg" id="set-target-43" alt="" class="update_thumb thumbs stdimage" src0="/members_php/content//contentthumbs/7-cat.jpg" cnt="1" v="0">

 

(0 vote(s))
Helpful
Not helpful

Comments (0)