Thanks for the response DR.
Isn't the "template tag library" already loaded in my example with
this line:
{% load page_tags %}
My pagination_links tag is in the page_tags.py file. So that should
work. Unless you are saying that the parent template (base.html that
introContent.html extends) needs to have a load statement in it too.
Is that what you are saying?
Just wondering b/c I don't really extract that meaning from the Djano
docs here:
http://docs.djangoproject.com/en/dev/topics/templates/#custom-libraries-and-template-inheritance
""""
When you load a custom tag or filter library, the tags/filters are
only made available to the current template -- not any parent or child
templates along the template-inheritance path.
"""
On Mar 18, 8:36 am, Daniel Roseman <[email protected]> wrote:
> On Friday, March 18, 2011 2:48:31 PM UTC, Mazery Smith wrote:
>
> > newbie here,
> > I'm running into a template syntax error where (as far as I can tell)
> > there shouldn't be one (yes, I've loaded my tags file before I tried
> > invoking my tag). I'm looking for help on how to debug it. I'm running
> > Django trunk.
>
> > I'm using template inheritance with a custom tag for pagination help.
> > I currently have "introContent.html" extending a "base.html" file. I
> > want to use a "pagination_links" tag from my "page_tags.py" tag file
> > (this example is from the Django e-commerce book)
>
> > ---------------------------------------------
> > # In introContent.html
>
> > {% extends base.html %}
>
> > {% block content %}
>
> > {% load page_tags %}
>
> > {% pagination_links request paginator %}
>
> > {% endblock %}
> > ---------------------------------------------
>
> > When I run this i get the error "expected 'endblock' or 'endblock
> > content".
>
> If that is the entire template, then you definitely do have an error - you
> haven't loaded the templatetag library that defines pagination_links. You
> need to load libraries in *every* template that uses them, even if it
> extends another one.
> --
> DR.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
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.