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.

Alternative Members Syntax

March 30, 2011 9:27am

Subscribe [2]
  • #1 / Mar 30, 2011 9:27am

    Doudi

    5 posts

    Hi,

    I’m having an issue with the Alternative Members Syntax for Global Member Variables (explained here: http://ellislab.com/expressionengine/user-guide/templates/globals/single_variables.html#alternative_syntax)

    It says: All of the member variables may be used with the addition of the prefix “logged_in_”.

    But I’m struggling to get this tag working, while the other ones shown on the list in the user guide do work:

    {logged_in_avatar_url}

    Does somebody knows a solution?
    Thanks!

    Diederik

  • #2 / Mar 30, 2011 11:52pm

    Lisa Wess

    20502 posts

    Hi, Doudi - Can you give us a bit of the surrounding context? Is this inside a channel entries tag? The custom profile data tag? Or just… floating in the template?

    Thank you!

  • #3 / Mar 31, 2011 6:19am

    Doudi

    5 posts

    Hi Lisa,

    It’s in a comment form, just beneath a dynamic entries tag.
    If I use {avatar_url}, the avatar of the article author is shown. I just want to show the avatar of the logged in user in the comment form.

  • #4 / Apr 03, 2011 4:44pm

    Greg Salt

    3988 posts

    Hi Doudi,

    I think that may just be an unclear bit of the documentation, the list of the available variables that use the logged_in syntax are listed there and logged_in_avatar_url is not one of them unfortunately. However, you could use the Query Module to do this:

    {exp:query sql="SELECT avatar_url FROM exp_members WHERE member_id = '{logged_in_member_id}'"}
    path/to/images/avatars/uploads/{avatar_url}
    {/exp:query}

    Does that help?

    Cheers

    Greg

  • #5 / Apr 05, 2011 11:02am

    Doudi

    5 posts

    Well, no. But it’s heading in the good direction. There’s only one problem left: {logged_in_member_id} doesn’t get parsed into the query tag

    {exp:query sql="SELECT avatar_filename FROM exp_members WHERE member_id = '{logged_in_member_id}'"}{/exp:query}

    But it does get parsed outside the tag. Is there a solution for that?

    Thanks!

  • #6 / Apr 05, 2011 8:42pm

    Lisa Wess

    20502 posts

    Is this inside a channel entries tag, Doudi?  If not, can you try {member_id} in there?  Alternatively, you may need to use the custom profile data tag.

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

ExpressionEngine News!

#eecms, #events, #releases