Adding another HTML field to the Knowledge Article

rajat
Kilo Explorer

Hi all,

My requirement is to add a similar field as "Text" on the knowledge creation form. I have created the field of type Translate HTML, but the content of the field is not being displayed when the article is viewed

A field u_long_text was added for that purpose to the kb_knowledge table with a Type of HTML so that they could enter HTML.

Anybody have any ideas?   Has anyone else done this before?

2 REPLIES 2

anplonka
Kilo Contributor

Hi, actually I have same problem. Does anyone knows the answer to this problem?


richelle_pivec
Mega Guru

We are in the process of upgrading to Fuji, which is when I realized that my second text field on our legacy knowledge articles wasn't displaying on the articles in the new knowledge base. Here's where I hunted it down to.



The UI Macro, "kb_view_custom.xml" is where I added the code that made that second field appear. This might be all you need to do if you are still using legacy knowledge.



<?xml version="1.0" encoding="utf-8" ?>


<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">



  <j:if test="${gs.hasRole('itil')}">


        <g2:no_escape>$[kb.u_it_content.getDisplayValue()]</g2:no_escape>  


  </j:if>



</j:jelly>




After that I added the code to this UI Macro to go and pull in the code from that UI Macro:



kb_view_common_body



<?xml version="1.0" encoding="utf-8" ?>


<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">


                      <j:if test="${showPillBox}">


                                              <g:inline template="kb_view_common_header_toolbar" />


                      </j:if>



                      <div class="kb-view-content-wrapper">


                                              <g:inline template="kb_view_notification" />


                                              <g:inline template="kb_view_common_header_banner_image" />


                                              <g:inline template="kb_view_common_content"/>


<g:inline template="kb_view_custom.xml"/>


                      </div>


                      <g:inline template="kb_view_common_footer"/>


</j:jelly>



Maybe there was a more elegant way, but this way worked to leave the legacy code as is and just pull it into the new UI Macro that is being used by the new knowledge base.



I hope that's helpful.



thanks,


Richelle