Jump to:

1835 Posts in 1139 Topics by 554 members

Blog Module

SilverStripe Forums » Blog Module » Blog poster avatars

Discuss the Blog Module.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1164 Views
  • MrMuddy
    Avatar
    Community Member
    13 Posts

    Blog poster avatars Link to this post

    Hi All,

    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 ?

    Many thanks

  • MrMuddy
    Avatar
    Community Member
    13 Posts

    Re: Blog poster avatars Link to this post

    OK... in the course of working through this I found a thread here :

    http://www.silverstripe.org/archive/show/4317

    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)

  • Capt. Morgan
    Avatar
    Community Member
    30 Posts

    Re: Blog poster avatars Link to this post

    Hi MrMuddy
    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.

    good luck

  • MrMuddy
    Avatar
    Community Member
    13 Posts

    Re: Blog poster avatars Link to this post

    Hello,

    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 !

    Cheers

    Tim

  • Capt. Morgan
    Avatar
    Community Member
    30 Posts

    Re: Blog poster avatars Link to this post

    I had misunderstod you. For some reason I thought you were talking about comments, not bloggers.
    Good to hear you got it solved

    1164 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.