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 channel entries based on username

January 30, 2012 9:00am

Subscribe [2]
  • #1 / Jan 30, 2012 9:00am

    stevealfa

    11 posts

    I’ve tried looking for a similar problem to this but I’ve not had much luck.

    Using EE2

    I’m looking to setup a simple system that shows client specific information depending on the username.

    For each user (there won’t be many) there will be multiple channel entries.
    I want to be able to display only the channel entries relevant to that user when they log in.

    What I’ve tried is to set up a channel and username that are exactly the same and call in that channel in an expression based on the username:

    {exp:channel:entries channel="{username}" limit="1000" disable="categories|pagination|trackbacks"}

    I’m guessing this isn’t working due to a parsing order, so my question is, Is there another way to go about this without setting up a template of tens of if, else:if statements checking for what user is logged in?

    I’d like the user to be able to log in and then on that next page see only the information relevant to them and a list of their entries.

    Thanks.

  • #2 / Jan 30, 2012 2:39pm

    Boyink!

    5011 posts

    One way is to register users into the system, put all the content in a shared channel, assign users as authors of their entries, and then use a conditional against the current_user constant:

    http://ellislab.com/expressionengine/user-guide/modules/channel/channel_entries.html#author-id

  • #3 / Jan 31, 2012 12:52pm

    Kevin Smith

    4784 posts

    Thanks for the help, Mike! Steve, does that set you up with a solution?

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

ExpressionEngine News!

#eecms, #events, #releases