1770 Posts in 495 Topics by 531 members
|Go to End|
18 March 2011 at 12:29am
I've been doing a bit of searching around and can't seem to find what I'm after (so please feel free to post a link to the right place !)
I've got the Blog module installed and running, with multiple contributors. They will only ever be Administrators or Content Authors on the site, so I'm not fussed about new member registrations or anything like that.
What I'm after is for Silverstripe to automatically fill in the author field when they post (like this thread : http://www.silverstripe.org/blog-module-forum/show/16216) but also for each of them to have an avatar which is displayed in the template next to their post.
Now... I'm guessing I probably need to extend the Member class ? But before I go chopping around, I'd like a bit of reassurance that I'm doing the right things.
Can anyone provide a couple of pointers as to how to add per-user avatars in the CMS ?
18 March 2011 at 12:51am
OK... in the course of working through this I found a thread here :
Which looks like it gets the avatars attached to the members... so that's a big start.
Just need to get them in the template and I'll be there. (and make sure the right user is being assigned to the post)
22 March 2011 at 3:56am
I just did smth similar few days ago on http://www.moviedeek.com/. The template you need to override is PageComment_instance I think. In my case I just included the picture provided by WillR's facebook connect module, but it seems like you already decorated your Member class with a profile image.
22 March 2011 at 4:02am
Thanks for the post. I got round it in the end by adding a function in the BlogHolder controller. With the member class suitably decorated as per the above thread), this function performs a custom SQL query to look up using the ID of the blog post to get the poster name and their avatar (along with a couple of other bits of info I added).
I call it from the BlogSummary template include, so it works at BlogHolder and BlogTree level.
I don't know if it's the "right" solution... but it seems to work OK !
25 March 2011 at 9:08pm
I had misunderstod you. For some reason I thought you were talking about comments, not bloggers.
Good to hear you got it solved
|Go to Top|