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.

author_id="current_user" problem

August 25, 2010 9:20am

Subscribe [2]
  • #1 / Aug 25, 2010 9:20am

    florian

    395 posts

    Hi,

    I can not get to the bottom of this problem.

    My author_id=“current_user” tag does not work correctly. I am trying to display posts by the currently logged in user. When I use “current_user”, nothing displays. When I hardcode the member_id then it displays correctly. I know that the correct user is logged in because I use {logged_in_member_id} as a test.

    I do not have the dynamic caching turned to yes. I have the correct status confirmed and also the post is not in the future.

    What else could be the problem? something in the ‘security and sessions’ settings??

    best
    Florian

  • #2 / Aug 25, 2010 3:50pm

    Ingmar

    29245 posts

    The constant would be CURRENT_USER, actually, like so:

    author_id="CURRENT_USER"

    Can you try that, please?

  • #3 / Aug 25, 2010 4:10pm

    florian

    395 posts

    I was hoping that somebody had some thoughts on this.
    Would there be an alternative way of doing this? different tag than author_id ?

  • #4 / Aug 25, 2010 4:11pm

    Ingmar

    29245 posts

    Hm, sorry? You can also try username=“CURRENT_USER”, of course.

  • #5 / Aug 25, 2010 4:15pm

    florian

    395 posts

    that’s actually the code that I used. the upper case one. it also does not display anything.

    It wouldnt matter how the member gets registered and what member group the belong to, right? I have cartthrob register the member after signup, and then member group is a custom one. From my limited knowledge, this author_id tag should stil work though. How else would I display only the logged in members entry?

    (ps: I am using this for a order history page .. )

  • #6 / Aug 25, 2010 4:20pm

    Ingmar

    29245 posts

    Can you show us a little more of your code? What version and build are you using? Any extensions?

  • #7 / Aug 25, 2010 4:21pm

    florian

    395 posts

    username=“CURRENT_USER” also displays all entries. I have tried that before.

    silly question. It is ok to be logged in in Internet explorer and then open up a new tab in the browser to go to my test template to test this out? I have nothing on the test template but the one entry code for testing, so not even a log in form. But I am logged in in the same browser in different tab.

  • #8 / Aug 25, 2010 4:22pm

    florian

    395 posts

    test template just uses a very simple code.

    {exp:weblog:entries weblog="orders" username=“CURRENT_USER” status="paid|open" }
    {title}
    
    {username}
    {/exp:weblog:entries}

    version ee 1.6.7

    extensions:
    fieldrame
    edit tab ajax
    onsubmit
    file
    favorites
    category checkboxes
    cartthrob
    google analytics
    multi relationship
    lg tiny mce

  • #9 / Aug 25, 2010 4:31pm

    florian

    395 posts

    username=“CURRENT_USER” seems even more messed up. even if I hardcode this with an actual username, I get weird restuls. always displays the first two entries. but not the actual entries that belong to the user.

    should i disable extensions? and try again

  • #10 / Aug 26, 2010 12:05am

    florian

    395 posts

    ok, I added three things..
    dynamic - off
    show future entries - yes
    status - not closed

    for some reason that worked..

  • #11 / Aug 26, 2010 5:58am

    Ingmar

    29245 posts

    Yes, that makes sense: that way you are showing all statuses (except, obviously, close) regardless of entry date. I am glad you found a solution 😊

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

ExpressionEngine News!

#eecms, #events, #releases