1

I created a field for users using the Profile 2 module with machine name "field_user_country"

I created a block on my user profile page and i need to dynamically display the country of the currently viewed profile.

I have tried various tokens and they do not work.

What token can I use to get the country of the currently viewed user profile?

Thank you.

1

I'm having the same issue at the moment. Looking into including a few fields from a Profile2 content type into a Display Suite custom code field.

I used the following PHP code in the custom code field (using php filter format and enabling tokens, just in case). Then I was able to view a collapsed tree of all tokens available to that node.

You could prabably do the same in a block and have it displayed when you need it.

<?php
$output .= 'Available tokens:';
$output .= theme('token_tree', array('node'), TRUE, TRUE);
return $output;
?>

I'm sure there's a better way, but that quickly worked for me! gOOD LUCK.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.