view bns_website/templates/news/news_list.html @ 41:9ce9f77d6cde

I added a get_absolute_url() to the news model so I can use that in the news template tag to create a link to the correct anchor on the news list page. The link works, but for some reason it goes to the beginning of the article content and not to the title. I've played around with the article tag and making an aside tag with an id and for whatever reason it always goes to the article content.
author Bob Mourlam <bob.mourlam@gmail.com>
date Sun, 06 Nov 2011 22:13:27 -0600
parents b9d6f6d930a9
children 9936cae358d9
line wrap: on
line source
{% extends 'base.html' %}
{% load core_tags %}
{% block title %}News{% endblock %}

{% block content %}
{% navbar 'news' %}
<h1>News</h1>
<dl>
{% for news in object_list %}
<aside id="news{{news.id}}">
<article class="article">
    <header>
        <h3>{{ news.title }} {% if news.is_new %}<span class="label success">New</span>{% endif %}</h3>
    </header>
    <section>
        <p>{{ news.content|safe }}</p>
        <small><b>{{ news.date }}</b></small>
    </section>
</article>
</aside>

{% endfor %}
</dl>

{% endblock %}