> How can I get Django templates to generate links to anchors that are
> *local* to the document?
> In a static HTML page, I have a table of contents with links to
> internal sections within the same page:
>
> <a href="#1">Section1</a>
> <a href="#2">Section2</a>
>
> These link to sections that  that look like this:
>
> <td id="1" class="section"> 111 </td>
> <td id="2" class="section"> 222 </td>
>
> Converting the above into a template I have:
>   {% for row in content.rows %}
>            <a href="#{{row.id}}">{{ row.label }}</a>
>
> but....when the template loads it creates output that looks like:
>
> <a href="http://localhost:8000/doc/#1";>

How are you checking that it's generating that absolute URL? It is
almost certainly your web browser that's showing you the links in an
absolute form. Try to look at the source code for your page or use
curl/wget to fetch the source and you will see that your template code
is just fine.

-Rajesh D

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to