Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to change Catalog Item layout

dianemiro
Kilo Sage

Hello Everyone

We have a page with this link: ServiceNow

This is the current layout of our Catalog Item form:

find_real_file.png

How can we change the layout to this?

find_real_file.png

Best Regards,

Diane Miro

1 ACCEPTED SOLUTION

dianemiro
Kilo Sage

Hi Everyone,



I was able to do this by modifying the UI Macros for Catalog Item and Order Guide.



Best Regards,


Diane Miro


View solution in original post

12 REPLIES 12

Shishir Srivast
Mega Sage

I think, you can change the short description in the catalog Item under



find_real_file.png


Hello Shishir



We don't want to change the "Short Description" of the form instead we want to add the Name of the form at the top of the layout.



Best Regards,


Diane Miro


Hi Diane,


You can use HTML,UI Macro or Ui Page field to add the content.Please try any one and let me know if any concern.



Regards,


P Ranjan


Hello Prakash



I am not familiar with UI Macro, can you show me how? I found a UI Page named com.glideapp.servicecatalog_cat_item_view:



<?xml version="1.0" encoding="utf-8" ?>


<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">


    <g:requires name="scripts/js_includes_catalog.js" includes="true"/>


    <g:requires name="styles/${new CatalogCssSelector().getVariableCss()}" includes="true"/>


    <g:requires name="styles/${new CatalogCssSelector().getCatalogCss()}" includes="false"/>


    <g:inline template="sc_sanitize.xml"/>


    <!-- check authorization -->


    <g2:evaluate var="jvar_cat_item_authorized" jelly="true">


              var answer = true;


              var item = GlideappCatalogItem.get(jelly.sysparm_id);


              if (item == null)


                    answer = false;


              else {


                    var preview = jelly.sysparm_preview;


                    if (preview $[AMP]$[AMP] gs.hasRole('catalog_admin'))


                          answer = true;


                    else


                          answer = item.canView() || !gs.nil(jelly.sysparm_cart_edit);


              }


              answer;


    </g2:evaluate>


    <j2:if test="$[!sysparm_catalog || sysparm_catalog == '' || sysparm_catalog == null]">


              <g2:evaluate var="sysparm_catalog" jelly="true">


                      var item = GlideappCatalogItem.get(jelly.sysparm_id);


                      var cat = item.getFirstAccessibleCategoryForSearch();


                      var sysparm_catalog = GlideappCategory.get(cat).getCatalog();


                      sysparm_catalog;


              </g2:evaluate>


    </j2:if>



    <j2:if test="$[jvar_cat_item_authorized]">


              <g:catalog_item />


        <j:if test="${new GlideappScriptHelper().isUI16Enabled()}">


  <script>


  catalogHistory.setHistory('$[HTML,JS:sc_cat_item.name.getDisplayValue()]', catalogHistory.getPageUrl());


  </script>


        </j:if>


    </j2:if>


    <j2:if test="$[!jvar_cat_item_authorized]">


              <g2:evaluate var="jvar_not_auth_msg" expression="var jvar_not_auth_msg=gs.getMessage('Not Authorized');jvar_not_auth_msg;" />


              $[jvar_not_auth_msg]


    </j2:if>


</j:jelly>



Where will I include the Name?



Best Regards,


Diane Miro