<$mt:AssetCount$>
Returns the number of assets associated with the active blog.
Attributes:
- type
-
Allows for filtering by file type. Built-in types supported are "image", "audio", "video". These types can be extended by plugins.
Example:
Images available: <$mt:AssetCount type="image"$>
Arvind Satyanarayan
July 24, 2008 3:46 PM | Reply
If you have an image asset with thumbnails, this tag returns a count that includes both of them. If you want to only count images, a good want to do that is to use the MTAssets and MTSetVar tag like so (it loops through MTAssets - which only returns images, and not thumbnails - and increments the $asset_count variable which you can then use):
<$mt:SetVar name="assetcount" value="0"$> <mt:Assets> <$mt:SetVar name="assetcount" op="++"> </mt:Assets>
Assets: <$mt:Var name="asset_count">Mihai Bocsaru
November 10, 2009 12:40 PM | Reply
You may like to use the following undocumented attributes for this tag:
singular="1 asset" plural="# assets" none="No assets"
Here is a sample of how you could use them:
<$mt:AssetCount singular="1 asset" plural="# assets" none="No assets"$>
The above would return:
"1 asset" or "9 assets" or "No assets".
You could customize the words "asset", "assets" and "No assets" from the above attributes.
Enjoy ;)