On Sun, Sep 25, 2011 at 10:42 PM, Grant Humphries <[email protected]
> wrote:
> I am referring to Tutorial number 3. When editing the 'polls/
> index.html' file, the tutorial says to input:
>
> {% if latest_poll_list %}
> <ul>
> {% for poll in latest_poll_list %}
> <li><a href="/polls/{{ poll.id }}/">{{ poll.question }}</a></
> li>
> {% endfor %}
> </ul>
> {% else %}
> <p>No polls are available.</p>
> {% endif %}
>
> I input exactly this (literally copied and pasted directly from the
> tutorial page).
>
> I got an error saying that {% else%} was an incomplete block!
>
> The only way to correct this was to make it (% else %).
>
What you've done here is turned that string into something the template
parser doesn't recognize as a template tag, so you no longer get an
incomplete block error since you've taken it out of any consideration by the
template parser.
>
> When I finished that, it then gave me an error saying that {% endif %}
> was an incomplete block!
>
> Again, the only way to correct was (% endif %)
>
>
You've done the same thing here, you have not really fixed the problem.
> Which way is correct????
> (% else %) OR {% else %}
>
>
{% else %} is correct. The sequence (% or %) means nothing to the template
parser. The problem is somehow with the {% if %} part of the block -- it
does not seem that has been included properly, and therefore the template
engine is reporting and error on any subsequent tag that is expecting that
previous tag to have been included. Alternatively it might be the end of the
{% forr %} that has not been done properly, but I'm not sure offhand if you
would get the error you are describing in that situation.
Karen
--
http://tracey.org/kmt/
--
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.