Log in

View Full Version : Using custom field value in the header template


JohnGaf
08-26-2007, 03:49 PM
Hi, I'm having some problems with displaying a custom field in the header.

If i.eg field5 is a name field, and I want to print out: Hello "name" in the header, why won't the following code work:

<if condition="$post[field5]">
Hello $post[field5]
</if>

We have something similar for the postbit_legacy template, but that would of course print out that value for each one who replies. Is that perhaps the problem? That the $post array isn't initialised when the header template is evaluated?

Thank you

Kirk Y
08-26-2007, 03:55 PM
The $post array is only available in the postbit templates. You need to use $bbuserinfo in its place.

JohnGaf
08-26-2007, 04:08 PM
Was thinking it might have been something like that. Just confirmed that it worked.

Thanks!