Ask Your Question

footer links to social networking sites and link to tags

asked 2011-07-28 17:43:49 -0500

mether's avatar

updated 2011-07-28 18:43:54 -0500

Evgeny's avatar

In stackexchange, every question has a footer

"Know someone who can answer? Share a link to this question via email, twitter, facebook, or linkedin"

Of course, since askbot has support for more including Google Plus now, encouraging users to share questions and answers is important for anyone using askbot. Typically successful sites have large majority of traffic (70 to 80%) that come from search engines and one of the sure shot way of increasing popularity is encouraging people to link to your site. So in addition to the facebook, twitter sharing links on the site of the questions, this is helpful

If you are just browsing a site. this footer is instead

"Not the answer you're looking for? Browse other questions tagged foo or ask your own question."

This is useful in encouraging a tag based search which often yields better answers

edit retag flag offensive close merge delete


note that it is incorrect to say that 'every question has a footer'... on stackexchange, only those questions _without answers_ have this footer, hence the "else" tag in the example below.
NoahY's avatar NoahY  ( 2011-07-28 22:16:02 -0500 )edit
yes. you are right
mether's avatar mether  ( 2011-07-30 16:53:15 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2011-07-28 22:10:12 -0500

NoahY's avatar

updated 2011-07-28 22:18:24 -0500

Not sure if it's kosher to just copy the code verbatim, but this seems to work:

    {% if answers %}


    {% else %}
        <h2 class="share-question">{% trans url=settings.APP_URL+question.get_absolute_url()|iriencode, name=settings.APP_SHORT_NAME|iriencode %}Know someone who can answer?  Share a <a href="{{ url }}">link</a> to this question via 
            <a href="mailto:?subject={{ name }}&amp;body={{ url }}">email</a>, 
            <a href="{{ url }}">Twitter</a>, 
            <a href="{{ url }}">Facebook</a>, or
            <a href=";url={{ url }}&amp;source={{ name }}">Linkedin</a>.{% endtrans %}
    {% endif %}
edit flag offensive delete link more


note: google+ doesn't seem to have such a link available:
NoahY's avatar NoahY  ( 2011-07-28 22:19:17 -0500 )edit
@Evgeny, can you merge this functionality?
mether's avatar mether  ( 2011-07-30 16:51:33 -0500 )edit
Done, many thanks to Noah.
Evgeny's avatar Evgeny  ( 2011-07-30 21:41:48 -0500 )edit
confirmed that all these works except for email. Posted as a separate bug
mether's avatar mether  ( 2011-07-31 08:55:18 -0500 )edit
when using "iriencode" I got a template error "no filter named iriencode". Changing it to urlencode sovles the problem.
DominiCattus's avatar DominiCattus  ( 2011-08-03 06:12:56 -0500 )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: 2011-07-28 17:43:49 -0500

Seen: 312 times

Last updated: Jul 28 '11