Hello! I’m using the Links backend to surface Help Center results for a client. I would love to spruce up the standard links result cards.
First, how can I add a CTA to the links card? I really like how this looks on the Yext website:
Second, is there anything I can do to customize the title or descriptions of these cards? In my case, the name of the company is appended to the end of the card’s title. It looks something like this:
The above is just an example of how every one of my Help Center result cards shows the company’s name – I’d like to remove it! Is there anything I can do to trim that portion of the card’s title?
Thanks!
Hi Sarah,
To add a CTA to the card, you need to make sure that you define the CTA in your hbs file as well as the component.js file. It would probably be easier to fork the standard card and make sure that you’re mapping to the right property names returned via the API for the links backend you’re using (instead of the Knowledge Graph). For example, if you’re using the GCSE backend, the title is returned as “htmlTitle” and the url as “link”. You can inspect the search and look at the API results to see the full list of fields available to you.
title: profile.htmlTitle,
url: profile.link,
In order to transform the htmlTitle field, try this:
title: profile.htmlTitle.split(' | ')[0],
This should remove the " | "+whatever else follows.
Hope this helps!
thanks to @christian for the assistance!