Skip to content

Instantly share code, notes, and snippets.

@msrivastav13
Last active March 24, 2016 21:14
Show Gist options
  • Save msrivastav13/d737c480be26df407f7b to your computer and use it in GitHub Desktop.
Save msrivastav13/d737c480be26df407f7b to your computer and use it in GitHub Desktop.
Lightning Component For Contact Support Button
<aura:component implements="forceCommunity:availableForAllPageTypes">
<aura:attribute name="supportURL" type="string" default="/s/contactsupport"/>
<ui:button aura:id="button" buttonTitle="Contact Support" label="Contact Support" press="{!c.navigate}" class="uiButton forceCommunityAskCommunity"/>
</aura:component>
<design:component>
<design:attribute name="supportURL" label="Support URL" description="Please add support URL for the button" />
</design:component>
({
navigate : function(component, event, helper) {
//Find the text value of the component with aura:id set to "address"
var address = component.get("v.supportURL");
var urlEvent = $A.get("e.force:navigateToURL");
urlEvent.setParams({
"url": address,
"isredirect" :false
});
urlEvent.fire();
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment