User Tools

Site Tools


Sidebar

developers:addons:tags:start

Table of Contents

Tags

Addon Tags are really cool, they allow you to do a lot. This is a very brief overview of how they work, for more details see the example addon. There are 2 main parts to make a tag work, first it must be declared in the info.php file, second it must have a matching method in the tags.php file. There are 3 main different tag types, see the documentation in the example addon for more details on each.1)

Core Tags

Starting in version 7.1.0, there are "core tags". These are tags placed mostly within system templates, that serve as a way to call a specific tag for all of the addons. Think of it like a core event but specifically for use in templates. You won't be adding these tags to templates on your own, although you could if you wanted, they are designed to be used by the built-in software.

What the tag will look like in a system template:

{addon tag_type='core' tag='tag_name'}

OR can also look like this on listing details page2):

{listing tag='tag_name' addon='core'}

Below is a list of core tags used in the software:

Tag name Where What Version added
browsing_before_listings_column system/browsing/main.tpl Insert contents below category links, and above the listings column (possible to make display in a column to left/right of main listing column) 7.1.0
browsing_before_listings system/browsing/main.tpl Insert contents below category links, and above the listings, but inside the same column as the listings 7.1.0
listing_action_buttons main_page/listing_*.tpl Insert "action" buttons on listing details page to show next to the listing title. Note that listing_id will be one of the passed parameters. This replaces the listing_display_add_action_button core event from previous versions. 7.1.0
listing_social_buttons main_page/listing_*.tpl Insert "social" buttons on listing details page. Note that listing_id will be one of the passed parameters. 7.1.0
1)
Told you it would be a brief overview! We already have very extensive documentation on how tags work, within the example addon, just download that addon and take a look at the file contents.
2)
When it does look like this, you would still define it using $core_tags. But it would work just like using a {listing} tag would work, meaning that it will pass in the $listing_id in the params.
developers/addons/tags/start.txt · Last modified: 2014/09/25 16:55 (external edit)