ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

{screen_name} Global wrong after calling {exp:member:custom_profile_data}

February 22, 2011 8:36pm

Subscribe [2]
  • #1 / Feb 22, 2011 8:36pm

    Adam Christianson

    115 posts

    Hi,
    I have a page on my site that displays an article and to get some of the author’s bio information I make a call to their custom member profile data passing their ID like this:

    {exp:member:custom_profile_data member_id="{author_id}"}
    {if footer_bio != ""}<hr>{/if}
    {footer_bio}
    {/exp:member:custom_profile_data}

    This works great, but then later in the same template I want to display the screen name of the currently logged in user. When I call the Global Variable {screen_name} it’s still showing the screen name for the member who’s ID I called using {{exp:member:custom_profile_data} and not the screen name of the currently logged in user. Is there something I need to so to reset/clear the global variable?

    I did have caching on for my article template and I tried turning that off, but it didn’t seem to make a difference.

  • #2 / Feb 23, 2011 10:09am

    Sue Crocker

    26054 posts

    Hi, Adam. Have you seen: http://ellislab.com/expressionengine/user-guide/templates/globals/single_variables.html#alternative_syntax

    Try the alternative syntax of logged_in_screen_name - see if that works.

  • #3 / Feb 28, 2011 4:54am

    Adam Christianson

    115 posts

    Thanks Sue. I didn’t notice that alternative syntax. That seems to be doing the trick.

  • #4 / Feb 28, 2011 3:27pm

    Ingmar

    29245 posts

    Very glad to hear it. Please post again as needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases