XF 2.2 get data-href

I'm trying to get the thread ID, to create a unique id for data-href in a 3rd party widget used in the thread. But I'm only getting the boards URL.

Code:
data-href="{$xf.options.boardUrl}/{$threadID}"
 
That's not the correct param.

Dump all vars in the template to see what it is - {dump (vars())} .
Ok did that. results below.. So I tried data-href="{$contentKey}" but still blank.

Code:
[COLOR=rgb(255, 255, 255)][TABLE width="100%"]
[TR]
[td]<html id="XF" lang="en-US" dir="LTR"[/td]
[/TR]
[TR]
[td][/td]
[td]data-app="public"[/td]
[/TR]
[TR]
[td][/td]
[td]data-template="thread_view"[/td]
[/TR]
[TR]
[td][/td]
[td]data-container-key="node-7"[/td]
[/TR]
[TR]
[td][/td]
[td]data-content-key="thread-44"[/td]
[/TR]
[TR]
[td][/td]
[td]data-logged-in="true"[/td]
[/TR]
[TR]
[td][/td]
[td]data-cookie-prefix="xf_"[/td]
[/TR]
[TR]
[td][/td]
[td]data-csrf="1732574743,174921eb5a88911c7c28158d19006629"[/td]
[/TR]
[TR]
[td][/td]
[td]class="has-no-js template-thread_view XenBase layout-classic style-dark sidebar-right  has-staffBar  xb-toggle-default xb-sidebar-show"[/td]
[/TR]
[TR]
[td][/td]
[td]data-run-jobs="">[/td]
[/TR]
[TR]
[td][/td]
[td]<head>
[/td]
[/TR]
[/TABLE][/COLOR]
 
There was a typo - use double {{ }}.

That looks like the template html not the vars.

Code:
 "thread" => Thread {#582 ▼
    #_getterCache: array:3 [▶]
    #_valueCache: []
    #_structure: Structure {#450 ▶}
    #_em: Manager {#231 ▶}
    -_uniqueEntityId: 46
    #rootClass: "XF\Entity\Thread"
    #_useReplaceInto: false
    #_newValues: []
    #_values: array:29 [▼
      "thread_id" => 44

but $thread.thread_id still results an empty result
 
Back
Top Bottom