Forum Discussion
Thanks, Kaela! When I tried ${page.context.thread} I was getting back some Java .toString() type notation. I had to search around a bit to find the env stuff. Thanks for the REST URL. I was hoping for a Freemarker variable, but REST will certainly work.
FYI, here is what I see when I use ${page.context.thread}:
lithium.eval.velocity.ThreadTemplateModel@e25235
I imagine this is an Object. How can I access members of this object?
- KaelaC14 years agoLithium Alumni (Retired)
Yeah, it's returning you a thread object. I will go check if the knowledge base has doc for the thread object, but in the meantime here it is:
thread
NOTE: YOU CAN NOT CALL THIS DIRECTLY – calls like page.context.thread will return you a thread
Method Decription Example Version / Branch thread.board get the board for this thread ${page.context.thread.board}
9.10 thread.topicMessage get the topic message for this thread ${page.context.thread.topicMessage}
9.1.0 thread.discussionStyle get the discussion style for this thread ${page.context.thread.discussionStyle}
9.10 thread.webUi.url get the url to the web page for this thread ${page.context.thread.webUi.url}
9.1.0 If all you want is the thread id, I think this would work
${page.context.thread.topicMessage.id}
- xorrkaz14 years agoGenius
Thanks again, Kaela. That sounded promising, but I'm getting weird results. My topic URL looks like:
/My-Board/Default-email-notification-to-original-person-starting-a/td-p/66
When I do an alert("${page.context.thread.topicMessage.id}"), I get a pop-up that says "3" (I expected 66). If I do a get on thread ID 3, I get something completely unrelated to this topic. Am I interpreting the value of this property incorrectly or is there a different property to grab?
- KaelaC14 years agoLithium Alumni (Retired)
oopsies - try this .${page.context.thread.topicMessage.uniqueId}
Related Content
- 11 months ago
- 4 months ago
- 10 years ago
- 2 years ago