Ask Your Question

Placing avatar next to question in homepage

asked 2014-09-19 18:37:58 -0600

comex's avatar

I would like to place user avatar's next to question in homepage. Any easy method to achieve this?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-10-04 19:46:48 -0600

comex's avatar

I ended up editing askbot/templates/widgets/question_summary.html file. I created a new html under widgets, called user_card_small.html. This is because user_card.html gives relatively big avatar to put near voting boxes.

Here is question_summary.html change. I used votes again, I was lazy to change style.css :)

<div class="votes">                                                      
    {% with question.get_owner() as theuser %}               
    {% include 'widgets/user_card_small.html' %}             
    {% endwith %}                                            

Here is user_card_small.html

{% import "macros.html" as macros %}
    thumbnail for the user - shown on the users listings
    and elsewhere
<div class="user-card">
    {{ macros.gravatar(theuser, 40) }}

Only problem though, it doesn't appear nice on the block since user_card has different size than voting box. Even though I played with css a bit, I couldn't get to fit it in the box.

edit flag offensive delete link more

answered 2014-09-27 04:14:34 -0600

zheli's avatar

The easiest way is to add a new skin and change the question template.

edit flag offensive delete link more


I posted the way I did it, not the best though.

comex's avatar comex  ( 2014-10-04 19:47:26 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-09-19 18:37:58 -0600

Seen: 249 times

Last updated: Oct 04 '14