How can i change catalog name only in portal?

Ankit Kumar6
Tera Contributor

Hi Team,

This is my catalog portal page and here i want to change this catalog name from "Removal from contractual Obligtion to "ABZ" only for  portal page without changing the actual catalog item name. 

How can i do this?

AnkitKumar6_0-1723461684285.png

 

6 REPLIES 6

Sandeep Rajput
Tera Patron
Tera Patron

@Ankit Kumar6 You can't keep different names of catalog item on portal and platform view. OOTB this is simply not possible unless you opt to apply some DOM manipulation.

 

Hope this helps.

@Ankit Kumar6 In case if you wish to achieve this using DOM manipulation then you can create following onLoad client script on your catalog item and change the name.

 

function onLoad() {
    var portalName =  '<Add name of your catalog item for portal here>';

   if (portalName) {
        document.querySelector('.item-header h2').textContent = portalName;
    }
}

 

Make sure to keep the UI Type of the client script as Mobile/Service Portal.

Hi @Sandeep Rajput 

Can you help me with how to do it using DOM manipulation? I'm not familiar with this concept.

@Ankit Kumar6 

 

You need to setup an On-Load Catalog Client Script as shown below :

AmitVerma_0-1723530804891.png

 

Ensure that Isolate Script is set to false and UI Type is Mobile/Service Portal.

 

function onLoad() {
    //Type appropriate comment here, and begin script below
    this.document.querySelector('.item-header h2').textContent = 'test1'; // Replace with the name required for the catalog item
}

Output :

AmitVerma_1-1723530902653.png

 


Please mark this response as correct and helpful if it assisted you with your question.