1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 UserFields variables

Discussion in 'Troubleshooting and Problems' started by duterte, Jun 21, 2016.

  1. duterte

    duterte New Member

    What are the available variables in Custom User Field "Value Display HTML"?
    I am trying to insert link to user profile, but it doesnt work:

    href="/member/{$user.username}.{$user.user_id}/"
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The available tokens are in the description of that box:

    These are straight string replacements in the code:

    library/XenForo/ViewPublic/Helper/User.php

    Code:
    		if (!empty($field['display_template']))
    		{
    			if ($multiChoice && is_array($value))
    			{
    				foreach ($value AS $choice => &$thisValue)
    				{
    					$thisValue = strtr($field['display_template'], array(
    						'{$fieldId}' => $field['field_id'],
    						'{$value}' => $thisValue,
    						'{$valueUrl}' => urlencode($thisValue),
    						'{$choice}' => $choice,
    					));
    				}
    			}
    			else
    			{
    				$value = strtr($field['display_template'], array(
    					'{$fieldId}' => $field['field_id'],
    					'{$value}' => $value,
    					'{$valueUrl}' => urlencode($value),
    					'{$choice}' => $choice,
    				));
    			}
    		}
    
     
  3. duterte

    duterte New Member

    How can I make this link work in "Value Display HTML"?
    href="/member/{$user.username}.{$user.user_id}/"
    Its not parsing ..
     
  4. Mike

    Mike XenForo Developer Staff Member

    The short answer is you can't. Those details aren't available; only the ones Jake mentioned.
     

Share This Page