Make entire card clickable in Service Portal Search Result Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi,
I want to make the entire search result card clickable in search result page.
Currently, only title is clickable. Any idea/suggestion how this can be implemented?
Thanks,
Rohit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
You would likely need to clone and modify the display widget, changing the <a> tags to wrap the entire container, rather than just the text. (You could also modify the OOTB widget but if the OOTB widget is modified by ServiceNow as part of an upgrade/patch, you'll need to manually review the changes. With that said, as a general best practice, even if you clone + modify, I'd review any changes to the OOTB widget during upgrades/patches.)
CTRL + right click on the widget -> open in widget editor -> in the HTML, adjust where the <a> tag with the link lives. You'll shift it to the container, rather than just the title.
Before you do any of this, double check that the instance options and widget options cannot accomplish this. I don't imagine they can, but it's worth checking.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Rohit Agarwal1 ,
The best approach is to clone your existing search page widget, update the cloned version, and use it on your search page instead of the Out-of-the-Box (OOTB) widget.
Here are the steps:
- Open the page in Page Designer and identify the widget's name.
- Clone the widget and assign it a new name and ID.
- Locate the card element within the cloned widget's HTML.
- Wrap the card element within an anchor tag (<a>). Use the same anchor tag used in the link.
- Save the cloned widget.
- In Page Designer, remove the OOTB widget and add your cloned widget.
- Test thoroughly and update the cloned widget directly if any styling adjustments are needed.
If this solution helps you then, mark it as accepted solution ✔️ and give thumbs up👍!