XF 1.5 How to use variable across forum

king8084

Well-known member
I see this thread, and this makes sense (for the most part):
https://xenforo.com/community/threa...in-the-page_container_js_head-template.23491/

but i'm having problems using a var that's used in my sidebar, in my thread_view. i believe this stems from my lack of understanding on how vars are stored/accessed globally across xen. in particular, i have a 3rd party mod which uses the following:

Code:
<xen:foreach loop="$threads" value="$thread">
<div id="aph_thread_{xen:raw $thread.thread_id}">
<div class="aph_thread">
<span style="float:left"><img src="{xen:raw $thread.forum.icon}" class="aph_thread_img" /></span>
</div>
</div>
</xen:foreach>
where $thread.forum.icon houses a string to an img path, set in acp.
how can i access this image path in thread_view (or elsewhere?). adding "<xen:container var="$threadId">{$thread.thread_id}</xen:container>" allows me to get the thread ID and I have the forum ID ({$forum.node_id}) of the thread i'm looking at, but i doubt i'm really getting very close just knowing these two :(

any help would be solid. thanks!
 
Last edited:
That variable just might not be available to that template.

To check you could do:

{xen:helper dump, $thread}
{xen:helper dump, $forum}

Add those to your thread view template and see is witter contains the icon path.

If they don't it will likely require some sort of back end code to expose it to the template.
 
That variable just might not be available to that template.

To check you could do:

{xen:helper dump, $thread}
{xen:helper dump, $forum}

Add those to your thread view template and see is witter contains the icon path.

If they don't it will likely require some sort of back end code to expose it to the template.
beautiful. i never knew the helper dump existed. that was quick and easy... the var is available in the $forum piece. thanks!
 
Back
Top Bottom