First time here? Check out the FAQ!
1

footer links to social networking sites and link to tags

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

Evgeny's avatar
13.2k
Evgeny
updated 2011-07-28 18:43:54 -0600
mether's avatar
1.5k
mether
asked 2011-07-28 17:43:49 -0600
edit flag offensive 0 remove flag close merge delete

Comments

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 -0600) edit
yes. you are right
mether's avatar mether (2011-07-30 16:53:15 -0600) edit
add a comment see more comments

1 Answer

0

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="http://twitter.com/share?url={{ url }}">Twitter</a>, 
            <a href="http://www.facebook.com/sharer.php?u={{ url }}">Facebook</a>, or
            <a href="http://www.linkedin.com/shareArticle?mini=true&amp;url={{ url }}&amp;source={{ name }}">Linkedin</a>.{% endtrans %}
        </h2>
    {% endif %}
NoahY's avatar
303
NoahY
updated 2011-07-28 22:18:24 -0600, answered 2011-07-28 22:10:12 -0600
edit flag offensive 0 remove flag delete link

Comments

note: google+ doesn't seem to have such a link available: http://stackoverflow.com/questions/6676658/share-link-on-google
NoahY's avatar NoahY (2011-07-28 22:19:17 -0600) edit
@Evgeny, can you merge this functionality?
mether's avatar mether (2011-07-30 16:51:33 -0600) edit
Done, many thanks to Noah.
Evgeny's avatar Evgeny (2011-07-30 21:41:48 -0600) edit
confirmed that all these works except for email. Posted as a separate bug
mether's avatar mether (2011-07-31 08:55:18 -0600) 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 -0600) edit
add a comment see more comments