SecureTemplates are a family of protected frame and button templates defined as part of FrameXML. Through attribute-based configuration, they allow addons to access some of the protected functionality. The templates are defined in FrameXML/SecureTemplates.xml, and functionality supporting them resides in FrameXML/SecureTemplates.lua
Suppose we wanted to create a button that, when clicked, would cast [Mark of the Wild] on the player. This can be solved by inheriting from SecureActionButtonTemplate and setting the relevant attributes. For example, using only XML:
<Ui><Buttonname="MyThornsButton"inherits="SecureActionButtonTemplate"parent="UIParent"><Attributes><Attributename="type"type="string"value="spell"/><Attributename="spell"type="string"value="Mark of the Wild"/><Attributename="unit"type="string"value="player"/></Attributes><Sizex="64"y="64"/><Layers><Layerlevel="OVERLAY"><Texturename="$parentIcon"file="Interface\Icons\Spell_Nature_Regeneration"setAllPoints="true"/></Layer></Layers><Anchors><Anchorpoint="CENTER"/></Anchors></Button></Ui>
This page was last edited on 9 August 2020, at 00:00.
Content is available under CC BY-SA 3.0 unless otherwise noted. Game content and materials are trademarks and copyrights of their respective publisher and its licensors. All rights reserved.
This site is a part of Fandom, Inc. and is not affiliated with the game publisher.