Re: Problems with first block
Thank you, x13 and creecode! On Tue, Apr 27, 2010 at 2:04 PM, x13wrote: > > Did you read the tutorial? > http://docs.djangoproject.com/en/1.1/topics/templates/#topics-templates > > Seems to be a syntax problem > > It's not > > {{ block dtd }} ... {{ endblock dtd }} > > the properly syntax (for last Django version) would be: > > {% block dtd %} ... {% endblock %} > > Notice you should not include 'dtd' in the endblock tag. > > -f > > > > > > > On Apr 27, 3:51 pm, Jonathan Hayward > wrote: > > I'm working on a base template. Django is giving a TemplateSyntaxError at > my > > first attempted block declaration: > > > > TemplateSyntaxError at / > > > > Could not parse the remainder: ' dtd' from 'block dtd' > > > > Request Method:GETRequest URL:http://linux:/ExceptionType: > > TemplateSyntaxErrorException Value: > > > > Could not parse the remainder: ' dtd' from 'block dtd' > > > > Have I overgeneralized where blocks are appropriate, or is "dtd" > something > > like a reserved word here? > > > > The template is: > > > > {{ block dtd }} http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;>{{ endblock dtd }} > > http://www.w3.org/1999/xhtml; xml:lang="en" lang="en"> > > {{ block head }} > > {{ block title }}{{ page.title }}{{ endblock title > }} > > {{ block head_favicon }} href="/static/favicon.ico" > > type="x-icon" /> > > type="x-icon" > > />{{ endblock head_favicon }} > > {{ block head_meta }} > > {{ block head_meta_author}}{{ endblock head_meta_author }} > > {{ block head_meta_charset }} > content="text/html; charset=UTF-8" />{{ endblock head_meta_charset }} > > {{ block head_meta_contentlanguage }} > http-equiv="Content-Language" value="en-US" />{{ endblock > > head_meta_contentlanguage }} > > {{ block head_meta_description }}{{ endblock > > head_meta_description }} > > {{ block head_meta_keywords }}{{ endblock head_meta_keywords > }} > > {{ block head_meta_othertags }}{{ endblock > head_meta_othertags}} > > > > {{ block head_meta_refresh }}{{ endblock head_meta_refresh }} > > {{ block head_meta_robots }}{{ endblock head_meta_robots }} > > {{ endblock head_meta }} > > {{ block head_rss }}{{ endblock head_rss }} > > {{ block head_css }} > > {{ block head_css_site }} type="text/css" > > href="/static/css/style.css" />{{endblock head_css_site }} > > {{ block head_css_section }}{{ endblock head_css_section }} > > {{ block head_css_page }}{{ endblock head_css_page }} > > {{ endblock head_css }} > > {{ block head_section }}{{ endblock head_section }} > > {{ block head_page }}{{ endblock head_page }} > > {{ endblock head }} > > {{ block body }} > > > > {{ block body_sidebar }}{{ endblock body_sidebar }} > > > > > > {{ block body_content }} > > > > {{ block body_header }} > > {{ block body_header_banner }}{{ endblock > body_header_banner}} > > > > {{ block body_header_title }}{{ title }}{{ > endblock > > body_header_title }} > > {{ block body_header_breadcrumb }}{{ > > endblock body_header_breadcrumb }} > > {{ endblock body_header }} > > > > {{ block body_announcements }}{{ endblock body_announcements > }} > > {{ block body_main }}{{ endblock body_main }} > > {{ endblock body_content }} > > {{ block body_footer }} > > {{ block body_footer_breadcrumb }}{{ page.breadcrumb }}{{ endblock > > body_header_breadcrumb }} > > {{ block body_footer_legal }}{{ endblock body_footer_legal }} > > {{ endblock body_footer }} > > {{ endblock body }}{{ block footer }} > {{ > > block footer_javascript }}{{ block > footer_javascript_site}} type="text/javascript" > > > > src="/static/js/jquery.js">{{ endblock > > footer_javascript_site }}{{ block > footer_javascript_section}}{{ endblock > > > > footer_javascript_section }}{{ block footer_javascript_page > }}{{ > > endblock > > footer_javascript_page }} > > {{ endblock footer_javascript }} > > {{ endblock footer }} > > > > > > -- > > → Jonathan Hayward, christos.jonathan.hayw...@gmail.com > > → An Orthodox Christian author: theology, literature, et cetera. > > → My award-winning collection is available for free reading online: > > ☩ I invite you to visit my main site athttp://JonathansCorner.com/ > > > > -- > > You received this message because you are subscribed to the Google Groups > "Django users" group. > > To post to this group, send email to django-us...@googlegroups.com. > > To unsubscribe from this group, send email to >
Re: Problems with first block
It is OK to include the name of the block in the endblock tag ( search for 'For extra readability' in < http://docs.djangoproject.com/en/dev/topics/templates/#template-inheritance >). It is optional and I find it useful when working with longer blocks. Toodle-looo. creecode On Apr 27, 12:04 pm, x13wrote: > Notice you should not include 'dtd' in the endblock tag. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Problems with first block
Did you read the tutorial? http://docs.djangoproject.com/en/1.1/topics/templates/#topics-templates Seems to be a syntax problem It's not {{ block dtd }} ... {{ endblock dtd }} the properly syntax (for last Django version) would be: {% block dtd %} ... {% endblock %} Notice you should not include 'dtd' in the endblock tag. -f On Apr 27, 3:51 pm, Jonathan Haywardwrote: > I'm working on a base template. Django is giving a TemplateSyntaxError at my > first attempted block declaration: > > TemplateSyntaxError at / > > Could not parse the remainder: ' dtd' from 'block dtd' > > Request Method:GETRequest URL:http://linux:/ExceptionType: > TemplateSyntaxErrorException Value: > > Could not parse the remainder: ' dtd' from 'block dtd' > > Have I overgeneralized where blocks are appropriate, or is "dtd" something > like a reserved word here? > > The template is: > > {{ block dtd }} "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;>{{ endblock dtd }} > http://www.w3.org/1999/xhtml; xml:lang="en" lang="en"> > {{ block head }} > {{ block title }}{{ page.title }}{{ endblock title }} > {{ block head_favicon }} type="x-icon" /> > />{{ endblock head_favicon }} > {{ block head_meta }} > {{ block head_meta_author}}{{ endblock head_meta_author }} > {{ block head_meta_charset }} content="text/html; charset=UTF-8" />{{ endblock head_meta_charset }} > {{ block head_meta_contentlanguage }} http-equiv="Content-Language" value="en-US" />{{ endblock > head_meta_contentlanguage }} > {{ block head_meta_description }}{{ endblock > head_meta_description }} > {{ block head_meta_keywords }}{{ endblock head_meta_keywords }} > {{ block head_meta_othertags }}{{ endblock head_meta_othertags}} > > {{ block head_meta_refresh }}{{ endblock head_meta_refresh }} > {{ block head_meta_robots }}{{ endblock head_meta_robots }} > {{ endblock head_meta }} > {{ block head_rss }}{{ endblock head_rss }} > {{ block head_css }} > {{ block head_css_site }} href="/static/css/style.css" />{{endblock head_css_site }} > {{ block head_css_section }}{{ endblock head_css_section }} > {{ block head_css_page }}{{ endblock head_css_page }} > {{ endblock head_css }} > {{ block head_section }}{{ endblock head_section }} > {{ block head_page }}{{ endblock head_page }} > {{ endblock head }} > {{ block body }} > > {{ block body_sidebar }}{{ endblock body_sidebar }} > > > {{ block body_content }} > > {{ block body_header }} > {{ block body_header_banner }}{{ endblock body_header_banner}} > > {{ block body_header_title }}{{ title }}{{ endblock > body_header_title }} > {{ block body_header_breadcrumb }}{{ > endblock body_header_breadcrumb }} > {{ endblock body_header }} > > {{ block body_announcements }}{{ endblock body_announcements }} > {{ block body_main }}{{ endblock body_main }} > {{ endblock body_content }} > {{ block body_footer }} > {{ block body_footer_breadcrumb }}{{ page.breadcrumb }}{{ endblock > body_header_breadcrumb }} > {{ block body_footer_legal }}{{ endblock body_footer_legal }} > {{ endblock body_footer }} > {{ endblock body }} {{ block footer }} {{ > block footer_javascript }} {{ block > footer_javascript_site}} type="text/javascript" > > src="/static/js/jquery.js">{{ endblock > footer_javascript_site }} {{ block footer_javascript_section}}{{ > endblock > > footer_javascript_section }} {{ block footer_javascript_page }}{{ > endblock > footer_javascript_page }} > {{ endblock footer_javascript }} > {{ endblock footer }} > > > -- > → Jonathan Hayward, christos.jonathan.hayw...@gmail.com > → An Orthodox Christian author: theology, literature, et cetera. > → My award-winning collection is available for free reading online: > ☩ I invite you to visit my main site athttp://JonathansCorner.com/ > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group > athttp://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at
Re: Problems with first block
Hello Jonathan, Use {% block dtd %} instead of {{ block dtd }}. {{ }} are for accessing variables < http://docs.djangoproject.com/en/dev/topics/templates/#variables >. {% %} are for tags < http://docs.djangoproject.com/en/dev/topics/templates/#tags >. Toodle-loo... creecode On Apr 27, 11:51 am, Jonathan Haywardwrote: > I'm working on a base template. Django is giving a TemplateSyntaxError at my > first attempted block declaration: > > TemplateSyntaxError at / > > Could not parse the remainder: ' dtd' from 'block dtd' > > The template is: > > {{ block dtd }} -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.