+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / display user profile photo on blog

display user profile photo on blog

4 posts, 0 answered
  1. Brandon
    Brandon avatar
    50 posts
    Registered:
    30 Jul 2009
    05 May 2011
    Link to this post
    have searched for hours on this topic and have not come across anything that seems related. is it possible to display the user profile photo on a blog post by that user? doesnt seem possible unless i create a new metafield on the blog post or edit page and force the user to select their "avatar" each time they post.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    05 May 2011
    Link to this post
    Hello Brandon,

    It would be possible with a custom control. You need to get the staged version of the content item in custom control that inherits from BlogPosts

    StagedContent stg = manager.GetCurrentState(content.ID, true, true);

    The StagedContent has a property Onwer that you can use to query the profile data and extract the profile image.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Brandon
    Brandon avatar
    50 posts
    Registered:
    30 Jul 2009
    05 May 2011
    Link to this post
    thanks ivan, but wouldnt this only return the user that created the blog and not the blog post?

    the way sitefinity handles blogs would lead me to believe that. i've implemented a new metakey on the editor side when a user goes to create a new blog entry on an already created blog, depending on their role, there is a new field added called author - this is filled in automatically based on the logged in user. so each blog post owner is actually the user that created that blog - but each blog post has the ability to change the author name based on if they are admin or based on who is logged in and makes a new blog post at the time.

    i guess i should've mentioned this in my earlier post. i have read so much info that my brain is about to explode. it's my understanding that because of how i mentioned above there is no great way to display a users profile photo if i can change each blog entry author name - what if all the names are identical - if i look up how you described then all the blog posts would have the same photo regardless of author name (unless each user created their own blog and posted only to it). am i wrong in this assumption? if not, any other suggestions or ideas?

    i've already run into this issue when adding a comment to a different users blog entry. i logged out, logged in as a different user, made a blog post. logged out then logged back in as me and when i made the comment on their post it showed the css as if i was the author on my comment - because i AM the owner of the blog. so now i have to figure out how to make this not occur as well.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    11 May 2011
    Link to this post
    Hello Brandon,

    By default the owner of the blog is owner of the post. If you want to have separate owner per post, you can achieve this with an additional metakey that is set at runtime with the current user ID or you can add the name manually.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
4 posts, 0 answered