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= currently logged in user

August 22, 2011 1:25pm

Subscribe [2]
  • #1 / Aug 22, 2011 1:25pm

    Jon @ Kernel

    122 posts

    Hello!  I’m having no end of trouble trying to get the following to work:

    On my page, the following:

    {embed="_templates/editprofile-varpass" authorloggedin="{logged_in_member_id}" parse="inward"}

    Calling the template at _templates/editprofile-varpass

    {exp:channel:entries channel="memberorganisations" dynamic="off" orderby="date" status="Associate|Non-Associate" author_id="{embed:authorloggedin}"}
    
    {exp:safecracker channel="memberorganisations" entry_id="{entry_id}"}
    <label for="title"><strong>Title</strong></label>
    
        <input type="text" name="title" id="title" value="{title}" size="50" maxlength="100">
      
    
    
        <label for="url_title"><strong>URL Title</strong></label>
    
        <input type="text" name="url_title" id="url_title" value="{url_title}" maxlength="75" size="50" />
      
    
    
     <hr >
    
    <div><input type="submit" name="submit" value="Submit" /></div>
    {/exp:safecracker}
    
    {/exp:channel:entries}

    But this bit simply doesn’t work:

    author_id="{embed:authorloggedin}"

    Neither does this, hence why I’m trying to use embed variables to get it done.:

    author_id="{logged_in_member_id}"

    However, simply switching out

    author_id="{embed:authorloggedin}"
    with
    author_id="1"

    works perfectly - the issue is that I obviously need to alter the page depending on who is actually logged in!  I’ve tried all manner of parse=“inward"s too, so that doesn’t seem to be the issue, and {embed:authorloggedin} does output the right value when I test it elsewhere in the embedded template.

    Any ideas?!

  • #2 / Aug 22, 2011 3:23pm

    alexmglover

    47 posts

    Have you tried turning on template debugging to see what is being output in author_id=”” ?

  • #3 / Aug 22, 2011 10:44pm

    Lisa Wess

    20502 posts

    Have you considered simply using CURRENT_USER?

    author_id="CURRENT_USER"

    and let EE do the rest of the heavy lifting?

  • #4 / Aug 29, 2011 5:28pm

    Jon @ Kernel

    122 posts

    Lisa - that’s fantastic.  Not quite sure why EE had such an objection to my passing it {logged_in_member_id}, but CURRENT_USER works perfectly.

    Thanks!

  • #5 / Aug 29, 2011 6:57pm

    Lisa Wess

    20502 posts

    It’s a parse order issue, Jon, which is part of why that parameter is there. =)

    I’m glad you got it working, and if anything else comes up, please do let us know.  Thank you!

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

ExpressionEngine News!

#eecms, #events, #releases