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.

get author name from url segment_3 username or author_id

January 22, 2012 8:08pm

Subscribe [4]
  • #1 / Jan 22, 2012 8:08pm

    florian

    395 posts

    This question may be related to a resolved thread.

    I want to show all entries that belong to an author on a ‘all posts by this author’ page. I followed the previous post from above and it was no problem using the username or author_id to show all the author’s entries. But I can not figure out how to show the authors name before the channel entry tag shows all the entries.

    So I want a line that says: All post/s by (author}. Then the list of all the entries.
    Can I somehow convert that username or author_id from segment_3 into the actual author? because just using {author} doesnt render, since I am outside of the channel entry tag.

    best
    Florian

  • #2 / Jan 23, 2012 6:41am

    zizther

    228 posts

    You just have to do this:

    {exp:channel:entries channel="default_site" author_id="{segment_3}" dynamic="no" disable="member_data|pagination|categories"}
    
            All posts by (author}
    
    {/exp:channel:entries}
  • #3 / Jan 23, 2012 8:05am

    florian

    395 posts

    alright. so using the channel entry tag again is the best way for that? I was trying to avoid that to cut down on extra queries but i suppose this shouldt work fine.
    thank you!

  • #4 / Jan 23, 2012 8:29am

    Boyink!

    5011 posts

    The channel:entries tag is the primary means by which EE retrieves content, so don’t be concerned about using it for it’s intended purpose..😉

    You could write your own custom query but I get a bit concerned with the security of that approach and member info showing in the URL.

  • #5 / Jan 23, 2012 5:49pm

    Shane Eckert

    7174 posts

    Hello Florian,

    Between Zizther’s example and Mike’s comment, you are set! I would have suggested the same thing.

    Thank you for using the forums!

    Cheers!

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

ExpressionEngine News!

#eecms, #events, #releases