I am having problem with comments styling, I tried all of the methods written here.
What happens is that somehow EE doesn’t recognize who wrote the comment, it bases div formatting on who is logged atm, and displays all comments in same formatting.
I used CSS formatting and have 2 classes, 1 for guests and 1 for superadmins.
Anyway I want EE to display comments to everyone in same manner, just to display comments from admin user in different color.
Not totally sure what it is that you want but there is another WIKI post with a method that I wrote up which deals with something like this.
Again, not sure if this is what you are after or whether you want for all members of a certain group to have their posts in a different style? The method I have written up makes the original author of the post have their comments come up differently.
I still can’t get this to work :( so I’m pasting the current code (from it you can also see what I am using for avatars - since they are also not working, EE pulls post author avatar for all comments.
No promises on this one as I am at work at the moment and this plugin that I have attached is very rough but I’m pretty sure it should do what you are asking for though.
You will need to find out the group_id=“1” parameter number for yourself by going to :
Admin->Members and Groups->Member Groups
Note down the Group ID of the admin group and use that number in the parameter. It may be the case that your admin group is 1 so you won’t need to change anything.
See if that works and I am going to add this into the plugins forum too.
Just wondering if the plugin had been of any use at all?
Best wishes,
Mark
Thanks for your help so far guys
I think that the problem must lay somewhere else in the page code since no matter what method I use EE interprets all comments as from user 1.
I am pasting now most of the page code (the relevant part) since I am sure a trained eye will spot an error somewhere
P.S. for information it would be the {entry_author_id} variable that would give you a different id each time, the {author_id} variable is literally for the id of the person who posted the entry not to do with comments. Using the {entry_author_id} would not be much use to you on its own though as you want to be able to style differently depending on a certain group. That is where my plugin should hopefully help you out!
Oops sorry just noticed your post after I had posted mine. So using my plugin what does happen?
You should find that if you use it as per the instructions that anyone in the group_id of 1 will have their comments styled differently to all others. Have you actually got any comments posted that are from different groups to be able to test this out?
If you try this code (code I was using to test this out on a stock install of 1.6.3) and ensure that you have some comments by the super admin group (I guess is still group 1) and also log out and post some comments via other users who aren’t in the admin group and also some guest posts and see if it does what you are expecting it to do. You can then style it up as appropriate.
{exp:group_comment member_id="{author_id}" group_id="1"} {if belongs_to_group} <p>This comment was made by someone in the Super Admin group</p> <p>{comment}</p> {if:else} <p>This comment was made by someone else!!</p> <p>{comment}</p> {/if} {/exp:group_comment}
No problem at all. Glad it is working as it was written very very quickly yesterday. It is a very simple plugin though so should just work a charm. Have used it now on a couple of sites that I am building too so thanks for requesting it in a round-about sort of way!!
When I get the time I will probably update the plugin so that it also handles more than one group. Might be nice if you say have more than one admin group and you want all the staff members of a site to look different to that of other peoples. Will probably add that in at some point as well.
For those having problems making {member_group} return anything but ‘1’ in their {exp:weblog:comments} tags, use {group_id} instead. {member_group} is meant to return the group # of the logged-in user; there’s just a typo in this article. Hope this saves somebody some time
For those having problems making {member_group} return anything but ‘1’ in their {exp:weblog:comments} tags, use {group_id} instead. {member_group} is meant to return the group # of the logged-in user; there’s just a typo in this article. Hope this saves somebody some time