XF 2.1 Dumping in templates

Wyvh

Member
Hey there,
I'd like to know how dump variables in templates on XF 2.1 ?

It used to be simple on 1.5 with the simple need to add this line of code: "{xf:helper dump, $forum}" as example, but can't seem to make it work right now.
Any idea ?

Thanks.
 
That's what I tried. Put it on the page_container template and kept checking; always got null, no matter what variable I put.
Tried those two:

{{ dump($forum) }}
{{ dump($user) }}
 
Seems to be "working", excepting the fact that the website takes ages to load. I suppose it's due to the important amount of informations or so..
Isn't there anything more specific to dump ? like xf_user or dunno ?

EDIT: Nevermind, got it loaded. However, the informations given aren't the ones I'm seeking. How could I retrieve user or forum infos ?
 
Isn't there anything more specific to dump ? like xf_user or dunno ?
If you want the visitor object, that's $xf.visitor.

EDIT: Nevermind, got it loaded. However, the informations given aren't the ones I'm seeking. How could I retrieve user or forum infos ?
Those variables wouldn't be available on every page. What exactly are you trying to do?
 
Sorry, but I need a last answer for this thread and I'll be good (thanks again @Jeremy P )

If $xf.visitor is for individual users.. what is it for the grouped stats ? (number of registereds, number of messages, etc.)
 
what is it for the grouped stats ? (number of registereds, number of messages, etc.)
That's not available in the PAGE_CONTAINER template. It's available in the widget_forum_statistics template {{dump ($forumStatistics)}}

Remember, not every bit of data is available in every template so you have to narrow down what template the information you want is in.
 
Thank you.
Is there any simple way to make it work on the PAGE_CONTAINER template ? With include or raw ?
 
Thank you.
Is there any simple way to make it work on the PAGE_CONTAINER template ? With include or raw ?
There's no "simple" way that I know of. You would need to add a PageParam (with setPageParam) which is done in PHP, not in the template system. And most likely would take some extensions to the different PHP files for each value you want.

As usual, I could be wrong. ;)
 
I see. Would it be possible to hack it around and simply move the widget_forum_statistics template, that appears in the sidebar by defautl, to somewhere else ?
 
Top Bottom