How to add "Attachment paperclip" button on top of the catalog item in Kingston version?

viraj4
Giga Contributor

How to add "Attachment paperclip" button on top of the catalog item in Kingston version?

Note - I have the attachment clip at the bottom but want at the top as well with same functionality. Can someone help with the steps?

10 REPLIES 10

Brad Bowman
Kilo Patron
Kilo Patron

You can add a variable of the Type Macro, or Macro with Label, and reference a UI Macro with the below code to replicate the Attachment icon in button format.

 

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

<button class="request_catalog_button_with_icon btn cat-btn btn-primary" onclick='attach()'>Attachments</button>

<script language="javascript">

function attach() {
saveCatAttachment(gel('sysparm_item_guid').value, 'sc_cart_item');
}

</script>
<!-- </td></tr></table> -->
</j:jelly>

 

Hi 

i tried the above code and its giving me attachment button but I want to have the attachment paper clip icon how to get that is my concern

Regards

Viraj

Try this

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<j:set var="jvar_attachment_icon" value="${jvar_icon_path}" />
<g:sc_button id="sc_attachment_button" label="${gs.getMessage('Attachment')}" title="${gs.getMessage('Attachment')}" 
    						classes="header_button icon-paperclip sc_paperclip btn-icon btn cat-btn btn-default" 
    							onclick="attach();" />
<script>

function attach() {
saveCatAttachment(gel('sysparm_item_guid').value, 'sc_cart_item');
}

</script>
<!-- </td></tr></table> -->
</j:jelly>

viraj4
Giga Contributor

Hi Vignesh,

The script you have provided is not working over the portal.Can you suggest please?

Regards,

Viraj