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.

How do I highlight the author's comment?

March 31, 2011 5:33am

Subscribe [4]
  • #1 / Mar 31, 2011 5:33am

    socialjoe

    21 posts

    How can I highlight an author’s comment, whether or not they are logged in?

    I have more than one user posting to a blog and there have been scenarios where the blog author for a post makes a comment when they’re not logged in and it doesn’t add the author class I have set up for it. (It works when they are logged in).

    This is what I’m using now, but again, it doesn’t work if the author is logged out, even though the email address submitted is the exact same:

    <article class="comment {if entry_author_id == author_id}auth{/if}">

    What am I doing wrong? How do I get this class added, whether or not the author commenting is logged in or not?

    Thanks for your help!

  • #2 / Mar 31, 2011 7:21am

    Mark Bowen

    12637 posts

    I’m very confused by what you’ve said above.

    Am I right in thinking that you have an author of an entry, let’s call him Joe Bloggs and he has written a post on your blog.

    You now have comments in that blog for the general public and non-logged in users to post to. You now have Joe the original author come along and post a comment whilst he’s not logged in to the system and you want it to show differently to the rest of the comments?

    If so then what sets him apart from all the other posters? How can ExpressionEngine possibly know that he is the author of the post?

    If you were to go by email then that could easily be fudged by someone else posting using his email address. If you’re not doing that then how else would the system know who they are?

    Best wishes,

    Mark

  • #3 / Mar 31, 2011 5:08pm

    Sue Crocker

    26054 posts

    Thanks for the assist, Mark.

    Socialjoe - I have to agree with Mark on this one. You can’t really depend on a whether or no the comment is really from someone who isn’t logged in. Does that make sense?

  • #4 / Mar 31, 2011 5:28pm

    socialjoe

    21 posts

    I was just hoping there was an option to look for the email address and add it based on that. I understand that someone could use the same email address, but if the email address is unique and not well know, it would be nice to have the option. I just don’t think it’s practical that all entry authors will log in before posting a quick comment.

    Is it possible to go into the control panel and assign the logged out comment from the author, so that it marks it as the author’s comment in the system, and thus applies the class to the comment?

    Thanks for your help.

  • #5 / Mar 31, 2011 6:02pm

    Mark Bowen

    12637 posts

    I’ve not tried but I guess you could write a conditional based around the {email} variable and run it against the authors email to do what you need. Not perfect but I guess it would work.

  • #6 / Apr 04, 2011 4:06am

    John Henry Donovan

    12339 posts

    socialjoe,

    Is it possible to go into the control panel and assign the logged out comment from the author, so that it marks it as the author’s comment in the system, and thus applies the class to the comment?

    At the moment no. But you are welcome to make a feature request

  • #7 / Apr 04, 2011 2:08pm

    socialjoe

    21 posts

    Ok, I’ve submitted the request. 😊 Thanks.

  • #8 / Apr 05, 2011 8:22am

    John Henry Donovan

    12339 posts

    No problems. Feel free to start a new thread if you have any more questions

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

ExpressionEngine News!

#eecms, #events, #releases