XF 2.1 How can I access a variable used in one template in another one?

Feanor

Active member
Specifically, I am trying to use $followers and $followersCount from member_about in another template such as member_view. How can I have the template see the data from these? Thanks.
 
Try this.

You can set "page" options in your content template which makes those values available in your container template, e.g. add to forum_view
HTML:
<xf:page option="forum" value="{$forum}" />
Use in PAGE_CONTAINER:
HTML:
{{ dump($forum.node_id) }}
 
Try this.
Unless I did it wrong, it doesn't seem to be working.

I added this to member_about:

HTML:
<xf:page option="followers" value="{$followers}" />
<xf:page option="followersCount" value="{$followersCount}" />


Then on member_view, {{ dump($followersCount) }} shows as null.
 
Unless I did it wrong, it doesn't seem to be working.

I added this to member_about:

HTML:
<xf:page option="followers" value="{$followers}" />
<xf:page option="followersCount" value="{$followersCount}" />


Then on member_view, {{ dump($followersCount) }} shows as null.
How did you manage to do it?
 
Top Bottom