Package: django_epfl
This page will talk about the EPFL templates for django. These templates have
been developed in order to reflect the “web2010”Link graphical chart of EPFL.To use these templates, adddjango_epflto yourINSTALLED_APPS. Then you
can inherit the base template by adding{% extends 'django_epfl/base.html' %}in a template.List of available blocksAll the following blocks are in the EPFL template. Each block is displayed in
its context and has its role description next to it.<html><head>additional_meta: Place here all the additional meta in the
HTML formadditional_links: Same for the links to additional resourcesadditional_css: Here for the CSS (don’t place CSS under
additional_links to improve clarity and template inheritance)additional_js: All JS that need to be loaded in the head
sectionpage_title: If using thetitlevar is not the best
option, you can use this block to set the page title</head><body>header: Here is the header include. By default, the header is
in English. (file:django_epfl/template_inc/header.en.html) To
see the other options, take a look thepackage doc<http://kis-doc.epfl.ch/django/template.html#change-header-language-search-option>.<div id=”main content”>breadcrumbs: It is where you will put the “EPFL > Project >
Section” navigation style.languages: Links in the top right corner that permit the
user to switch between languages.<h1>title: Area for the title of the project and (in general)
its acronym.</h1>main-navigation: Area that contains droplists and all the
navigation for the project.tools: Space for the tools like RSS feed button, share
button and so on.<div id=”content”>content: Contains the main content for the page.</div><div id=”right-col”>right_column: Contains the secondary content in the right
column. If empty, the template will automatically switch to
1-column mode and the “right-col” div will not be displayed.</div>footer: Area for general contents like contact link,
copyright, …</div>additional_js_ajax: Place JS that don’t need to be loaded
first.</body></html>List of available variablesFor the moment, only thetitlevar (representing the page title) is
available. Care to not be confused with thetitleblock which is the big
black title on the page.NoteIf title var is set,page_titleblock won’t be displayed.Use the EPFL error pagesIn order to handle EPFL 404 error page, you have to modify your fileviews.pyand put in it this:from django.shortcuts import render_to_response

def error404(request):
    return render_to_response('django_epfl/errors/404.fr.html')Then, in yoururls.py:from django.conf.urls.defaults import handler404

handler404 = 'django_site.views.error404'To handle the 500 error, it is the same logic. Since errors like
503 are not natively supported, you will have to create and raise it in your
code. Some explanations on how to do thishere.https://docs.djangoproject.com/en/1.3/ref/request-response/#ref-httpresponse-subclassescan help you too if you need to return some HttpResponse with a defined status
code.NoteThe 404 and 500 error pages won’t be displayed ifDEBUGis set toTrue.Change header language / search optionYou can change the header with theheaderblock.There are four different headers available in thetemplates/template_incdir:header.fr.htmlheader.en.htmlheader-no-local-search.fr.htmlheader-no-local-search.en.htmlObviously, in the header name,frmeans French andenEnglish. Theno-local-searchversion of the header does not include the search option “On
this site”.