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.

Display Author-specific Posts with Author Name in the URL?

March 25, 2010 12:47pm

Subscribe [5]
  • #1 / Mar 25, 2010 12:47pm

    ian Pitts

    175 posts

    We currently have a blog on our corporate site that features multiple authors across various categories. It currently allows the view to be filtered by an author’s author_id, but this doesn’t give us any SEO traction.

    Is there a way to use an author’s name (not screen name) to display a list of posts from just that author? I assume it would involve some kind of exp:query and some PHP magic but if anyone knows of an existing plugin or extension that helps, it would be appreciated.

  • #2 / Mar 26, 2010 1:07am

    ChiefAlchemist

    913 posts

    Hello Mr. 100

    Not sure. But my concern would making sure the names are unique. User name, I believe, is enforced to be unique. Name isn’t. Granted, all your users might have unique names by “luck” but that might not always be true.

  • #3 / Mar 26, 2010 1:10am

    Lisa Wess

    20502 posts

    Try using:

    {exp:weblog:entries username="{segment_3}" dynamic="off" limit="20"}

    Or whatever segment the author’s name is in the URL.

  • #4 / Mar 26, 2010 7:33am

    ian Pitts

    175 posts

    @Chief - Yeah… that was the initial issue and that current usernames might be things like “iso100” and not “Ian Pitts” which is what we want to display to the rest of the world, but I guess that’s easily changed.

    @Lisa - I believe what I’ll probably end up doing is changing all blogger usernames to be url-safe analogues of their real names. Take the low-tech route versus using PHP url-safe conversion and SQL querying to find usernames from Screen Names…

  • #5 / Mar 26, 2010 8:49am

    ChiefAlchemist

    913 posts

    ISO…

    What if you just did both? /name/user_id and used the id for the query? The name is just there for SEO and user friendly purposes. In fact, you can even add another “descriptive” segment for SEO purpose. Just keep using the id for the query. Yes, no ID in the URI would be SEO great but adding the name, etc. will be a big help. The id ain’t gonna kill ya


    btw, The same idea can be applied to your title tags. I believe it’s recommended to keep that between 160 and 200 chars. That’s quite a bit more SEO oomph than just “About” 😊

  • #6 / Mar 26, 2010 10:07am

    ian Pitts

    175 posts

    Yep… I’ve done that on press release detail pages. The ID is the only EE-useful bit and then we tag on the {url_title} for some more SEO keyword exposure.

    I was hoping to be super-clean without any other nonsense in the URLs. Something like:

    http://www.site.com/blog/author/ian-pitts/

    But this would technically work too:

    http://www.site.com/blog/author/23_ian-pitts/

    ... just isn’t ideal.

  • #7 / Mar 26, 2010 1:38pm

    ChiefAlchemist

    913 posts

    Actually, what I’m suggesting is

    http://www.mysite.com/blog/author/bob-smith/12

    or

    http://www.mysite.com/blog/author/12/bob-smith

    or

    www..mysite.com/blog/author/big-bob/bob-smith << with big-bob being bob smith’s user name (which is unique).

    then use segment to pick the “variable” you want to use for your query. I don’t see a need to concat the ID to the user name. And I don’t think having the ID tucked in the URL is going to hurt you all that much with SEO. In fact, the user_name might be a positive there and it’s the unique ID you need. Name ain’t gonna be unique enough, IMHO.

  • #8 / Mar 26, 2010 2:53pm

    ian Pitts

    175 posts

    Yep. Either of those will work. Since I have control over the User accounts of those who will be blogging, I’ll just dictate that their user names be “bob-smith” and not “jumbobob1956”.

  • #9 / Mar 26, 2010 2:57pm

    ChiefAlchemist

    913 posts

    Or if you wanna get evil you *can* make it jumbo-bob-1956. lol

    Don’t forget, - is better than _ 😉

  • #10 / Mar 26, 2010 3:06pm

    ian Pitts

    175 posts

    This is a stuffy corporate site, so no silly i-just-got-my-aol-account usernames will fly being rendered to the visitor. 😉

    Yes, definitely. One of the first things I change on fresh EE installs… as they default to _ and - is much preferred by ole’ Google.

  • #11 / May 20, 2010 9:38am

    John St-Amand

    865 posts

    Hi there - this thread pertains to my issue at the moment - the segment is the way i did this too, with a template for viewing by author and the author id number as the segment in question (I’ll certainly look to do it with the username though for SEO purposes once i correct my problem).  The problem I’m having is pagination when that’s done.  For pagination, i simply added the usual paginate tag just before the closing of the entries tag. So:

    {paginate}
    Page {current_page} of {total_pages} pages {pagination_links}
    {/paginate}

    And so what this winds up adding for the page 2 link is P10 (because I’m paginating after 10 entries) and it adds that to the segment after the author id that i had at the end of my url to identify the id to my entries tag.  But it’s not working for me.  instead of paginating, I simply get the same list overagain.  Any suggestions?

    So my entries tag looks like this:

    {exp:weblog:entries weblog="{my_weblog}" orderby="date" status="open|Featured" sort="desc" limit="10" disable="member_data|trackbacks" dynamic="off" author_id="{segment_3}" pagination="bottom"}
    
    <!-- S BLOG ENTRY ROW -->
    <div id="blog_entry">
    
    MY TITLES AND ALL OF MY CUSTOM FIELDS DECLARED IN HERE
    
    </div>
    <!-- E BLOG ENTRY ROW -->
    
    {paginate}
    Page {current_page} of {total_pages} pages {pagination_links}
    {/paginate}
    
    {/exp:weblog:entries}

    And author id is segment 3, as seen here:

    http://www.scalepassion.com/index.php/blog/author/2/

    Any thoughts on why the pagination isn’t working for me?

    Thanks,
    John

  • #12 / May 20, 2010 11:50am

    Lisa Wess

    20502 posts

    You have

    pagination="bottom"

    You want:

    paginate="bottom"

    Docs on paginate parameter.

  • #13 / May 20, 2010 11:58am

    John St-Amand

    865 posts

    Oh for crying out loud!  That was a silly mistake.  Working perfectly now.  Thank you!

  • #14 / May 20, 2010 12:31pm

    Lisa Wess

    20502 posts

    But of course. =)

  • #15 / May 20, 2010 2:27pm

    ChiefAlchemist

    913 posts

    I’ll tell ya, that’s what we need a Dreamweaver for EE. Something that does autocompletes, shows tag parms, etc. Can you imagine how much time would be saved across the EE universe if there was something like that 😊

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

ExpressionEngine News!

#eecms, #events, #releases