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

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
updated 13 years ago
mether's avatar
1.5k
mether
asked 13 years ago

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 (13 years ago)
yes. you are right
mether's avatar mether (13 years ago)
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 %}

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
NoahY's avatar
303
NoahY
updated 13 years ago, answered 13 years ago
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 (13 years ago)
@Evgeny, can you merge this functionality?
mether's avatar mether (13 years ago)
Done, many thanks to Noah.
Evgeny's avatar Evgeny (13 years ago)
confirmed that all these works except for email. Posted as a separate bug
mether's avatar mether (13 years ago)
when using "iriencode" I got a template error "no filter named iriencode". Changing it to urlencode sovles the problem.
DominiCattus's avatar DominiCattus (13 years ago)
see more comments