Forum Discussion

Inactive User's avatar
Inactive User
7 years ago

How do I get message id from Article Editor Page?

Looking to get a unique id for the TKB article editor page, i.e., the bolded id /t5/tkb/articleeditorpage/tkb-id/(node-name)/message-uid/749 

without getting the http.request.url, which would be a hack. 

However, all of these fail:

 

env.context.message.uniqueId

env.context.message.id

page.context.message.id / uniqueId

page.context.thread.... etc.

 

What's the best way to get this ID without using http.request.url?

  • Inactive User - As per this document,  one the following pages seem to support the context objects to fetch this ID. If this page is associated with a thread, then this returns a thread context object, otherwise returns null. The following pages return a thread:

    • MobileTkbArticlePage
    • TkbArticlePage
    • TkbArticlePrintPage

    <#if page.context.thread??></#if>
    ${page.context.thread.topicMessage.uniqueId}
    ${page.context.message.uniqueId}
    ${page.context.user.id}

     

    I hope this helps.

    • Inactive User's avatar
      Inactive User

      Thanks VarunGrazitti, however, this is the TkbArticleEditorPage, so it’s neither officially a thread or a message and these don’t work on it. I'm not sure what will...

  • Hi Inactive User

     

    I hope this piece of code will do the work.

     

    <#assign MessageId = webuisupport.path.parameters.name.get("message-uid").uniqueId >

    ${MessageId}