How to create a simple button on a catalog item?

Subhashree3
Giga Contributor

Hi All,

We have a requirement to create a button on the catalog item that will only be visible when the user opens in service portal.I tried as per below step but I observed instead of service portal, its appearing at the RITM level. Could you please let me know how to implement a custom button on catalog item only?

steps i followed:

 1. Created a UI Macro under System UI.

//XML Code

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<div>
<button type="button" class="btn btn-default btn-block" onclick="alert('Hello world!')">Next</button>
</div>
</j:jelly>

2. Created a Widget under Service Portal

//HTML Code

<div>
<!-- your widget template -->
<button type="button" class="btn btn-default btn-block" onclick="alert('Hello world!')">Next</button>
</div>

*For now I have not added any functionality under Client cOntroller and Server script

3. Created a variable in the catalog item of Macro type and mapped this UI macro and WIdget I created.

Instead of appearing at the Catalog Item, its appearing under RITM level. Please let me know your suggestions.

find_real_file.png

Thanks

1 ACCEPTED SOLUTION

In variables keep macro and summary macro field empty.

find_real_file.png

 

 

and Now add the widget as shown below

View solution in original post

17 REPLIES 17

Hi Sandeep,

I tried these steps as i have mentioned in my questions but the button was not appearing in the catalog item. 

is there any other step that I am missing?

in variable do not map UI macro.

Just map the widget

 

In variables keep macro and summary macro field empty.

find_real_file.png

 

 

and Now add the widget as shown below

Thanks Sandeep. Its working fine now.

 

Thanks you both for your help.

Can you please mark as correct answer