Skip to content

Instantly share code, notes, and snippets.

@mbabker
Created May 26, 2012 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbabker/2793664 to your computer and use it in GitHub Desktop.
Save mbabker/2793664 to your computer and use it in GitHub Desktop.
Display compatibility badges on Akeeba Release System "Latest Releases" view
/*
* Create an HTML Layout Override for components/com_ars/views/latest/tmpl/category.php
* and insert the below snippet just below the $released = new JDate... line
* A live example of this can be found on http://www.babdev.com/extensions/latest
*/
// Additons to get all supported versions per release (for when multiple items support different versions)
$i = 0;
$versions = array();
foreach ($cat->release->files as $environment)
{
$supported = json_decode($environment->environments);
foreach ($supported as $version)
{
$versions[$i] = $version;
$i++;
}
}
$environments = ArsHelperHtml::getEnvironments(json_encode(array_unique($versions)));
/*
* The below snippet can be inserted into the HTML to display the badges
* (I did it just below the released date)
*/
<?php if(!empty($environments)): ?>
<span class="ars-release-property">
<span class="ars-label"><?php echo JText::_('LBL_ITEMS_ENVIRONMENTS') ?>:</span>
<span class="ars-value"><?php echo $environments; ?></span>
</span>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment