Reputation: 149
I am doing a simple web page using django. So i have a table that has a list of articles, each article has name, id, summary and link. The idea is to make the article name as a link when you show it up in the table:
<table class="table table-striped table-bordered table-hover table-condensed" style="font-family: Arial, Helvetica, sans-serif">
<thead>
<tr>
<th>Name</th>
<th>Id</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
{% for article in articles %}
<tr>
<td>{{<a href=article.link>article.name</a>}}</td>
<td>{{ article.Id}}</td>
<td>{{ article.summary}}</td>
<td><a href="{% url 'editArticle' article.id %}">Edit</a> <a href="{% url 'eraseArticle' article.id %}">Delete</a></td>
</tr>
{% endfor %}
</tbody>
</table>
But then this error appears: Could not parse the remainder: 'article.name' from 'article.name'
Upvotes: 1
Views: 26
Reputation: 476557
Using makes no sense, you do this with:{{<a href=article.link>article.name</a>}}
<a href="{{ article.link }}">{{ article.name }}</a>
Upvotes: 1