Promotes API

With promotes API you can generate a link or button, depending on the classes that you are using, that will allow administrators to promote an item.

promote

Left: Item can be promoted. Right: Item is promoted, can be unpromoted.


API example

jimport('oniscore.promote'); //import promotes libraries

$promotesHTML  = onisPromote::promote((int)$petition->id, 'petition', 'btn btn-xs btn-default', CCOMPONENT);

Generate the HTML code:

onisPromote::promote($itemid, $item, $class = NULL, $component);
  • $itemid - unique, numerical item id;
  • $item - unique item name;
  • $class - css class for the button;
  • $component - component name;

You can change HTML code here:

libraries/oniscore/promote.php

When an item is promoted it will be added on the mainpage of the component, if more items are promoted there will be a carousel with all the promoted items. The HTML code for the promoted items can be found here:

components/component_name/templates/default/item.promoted.list.php

promote carousel

Carousel with promoted items.

Joomla! ® name is used under a limited license from Open Source Matters in the United States and other countries.
Onis is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.

Onis does not sell it's products on 3rd party sites. Any website offering Onis products for sale are not licensed versions and should be considered a scam. Never download our products from file sharing websites like rapidshare, torrents or warez forums. We have received reports of malicious versions of our software containing viruses, extra code, and even once installed, delete your database, steal sensitive information such as passwords, and credit card information. There is only one place to get the full and safe licensed versions of our software and you're looking at it! Enjoy.