Show Attachments of Search Record on ServicePortal

Jeferson Rocha
Kilo Contributor

Hello Community.

I activated the attachment index on a table and created a search source for the same table so I could search for it on the service portal.

The search is working as expected, but I want the attachment to show on the result page just like it shows on the knowledge base. Below are some pictures to better illustrate my requirement:

I want this kind of result: 

find_real_file.png

On this page:

find_real_file.png

Any help or recommendations?

Thanks in advance.

 

3 REPLIES 3

Yoshita
Tera Contributor

Hello,

 

Go to Widget search page(to the page where results get displayed)- add SpAttachmentManager angular provider and add the following code to the template of search source for KB.

 

<sp-attachment-manager table="'kb_knowledge'" sys-id="item.sys_id" omit-edit="true"></sp-attachment-manager>

 

Mark as correct if it solves the issue.

Regards,

Yoshita.

Hello Yoshita.

This suggestion of yours is already implemented, the only issue is that it only brings the attachment itself, not the summary like it does on the knowledge base.

Thanks for your reply.

In this macro, kb_attachment_list_entry, check if the following line exists to display the terms, which actually contains the summary

<j:if test="${!empty(jvar_attachmentObj.terms)}">
<div style="margin-left: 3em;"><g:no_escape>${jvar_attachmentObj.terms}</g:no_escape></div>
</j:if>

 

Mark this correct if this helps.