
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2024 11:27 AM
I am using a custom widget in which on the HTML part, I am having a code section for a button-- "Get Support"
----------------------------------------------------------------------
<li class="gt-menu-item">
<button class="btn-supportOne" onclick="window.location.href='?id=one_assist_clone'" role="menuitem" aria-label="Redirect Button">
Get Support
</button>
</li>
---------------------------------------------------------------------
Now, mine requirement is that I do not want this button to be visible on the employee center homepage.
What, where I need to make changes so that I can achieve this functionality.
Thanks & Regards
Utsav
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2024 11:07 PM
Hi @Utsav JAISWAL ,
you need to fetch url prefix of the portal then add the condition.
example
in widget html :
<li class="gt-menu-item">
<button class="btn-supportOne"
onclick="window.location.href='?id=one_assist_clone'"
role="menuitem"
aria-label="Redirect Button"
ng-if="data.portalid !== 'esc'">
Get Support
</button>
</li>
in server script:
(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */
var portalid=$sp.getValue('url_suffix');
data.portalid = portalid;
})();
then it will hide for ESC then it will be there for other portal if they use this widget in other.
Please mark helpful & correct answer if it's really worthy for you.
Thanks,
BK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2024 11:07 PM
Hi @Utsav JAISWAL ,
you need to fetch url prefix of the portal then add the condition.
example
in widget html :
<li class="gt-menu-item">
<button class="btn-supportOne"
onclick="window.location.href='?id=one_assist_clone'"
role="menuitem"
aria-label="Redirect Button"
ng-if="data.portalid !== 'esc'">
Get Support
</button>
</li>
in server script:
(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */
var portalid=$sp.getValue('url_suffix');
data.portalid = portalid;
})();
then it will hide for ESC then it will be there for other portal if they use this widget in other.
Please mark helpful & correct answer if it's really worthy for you.
Thanks,
BK

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2024 11:25 PM
Hi @Bhavya11 Thankyou very much for the support, it is working as expected..
Just one update ---suppose if I want that the button should only not visible to employee center home page, and else where it should be there...
Example:- Suppose I want to make this visible for below page. And hidden on the esc homepage
Thanks in Advance
Utsav