Forum Discussion

Quelyn's avatar
Quelyn
Genius
10 years ago

Hiding the choice for "TKB Templates"

Currently our users get an option whenever authoring a KB to choose from one of the templates. 

We just want all users to use Freeform.  Ideally hitting "New Article" would just take you to the actual editing page, and not to this choice first. 

 

Has anyone figured out how to accomplish this in their environment? 

  • Hey Quelyn ,

    You sure can.

     

    The TKB template page reads in values from the URL.

     

    http://{CommunityURl}/t5/tkb/articleeditorpage/tkb-id/{TKB ID String}/message-uid/{ID number for message to draft from}/template-id/freeform

     That URL will start a new TKB in a specified TKB, feeding off the message ID and using the freeform template.


    Just create yourself a custom component using that structure and generate a link direct to the page.

    If you want to start from scratch you can drop the message UID completely like this:

    http://{CommunityURl}/t5/tkb/articleeditorpage/tkb-id/{TKB ID String}/template-id/freeform

     Piece of cake :)

     

    Tim

     

    • Quelyn's avatar
      Quelyn
      Genius

      Tim_h Thanks for this reply, I haven't been able to work on this piece for a bit, sorry for the delay. 

       

      I am trying to put this together. I made a new component called "menu-bar@override".  Trying to get the original code from the menu-bar component is escaping me though.  Is there a way we can see the actual code break down?  Copying the HTML from the source on the loaded page isn't the best because it doesn't have any variables anymore.  

       

      If I use @delegate, then I can't edit the normal code in there.  

       

      I might just be missing something... am I going about this wrong?

      • Tim_h's avatar
        Tim_h
        Boss

        Hi Quelyn , I don't think there's a way to get the code of an original component.

        Normally you'll need to look at the functionality and create freemarker/api calls to recerate that.

         

        Which menu component are you overriding?

         

        If it's within a forum post you an just write your code to get the message id of the parent post and link to the TKB form from there.

        If it's within the TKB drafts section for nominated posts it'll be a little more work to replace the individual rows generated from topics.

         

        The former is much easier to do, it'll just come down to where you insert the component. I've never inserted one into the menu list dropdown sorry. Only added a new button for things :)


        Tim