Hi Ellen, Sounds like what you're looking to do is template inheritance. You can most definitely add dynamic bits of code based on individual pages. Some documentation on the topic can be found here: http://docs.djangoproject.com/en/dev/topics/templates/
Basically what I think you'll need is to create a main template and have your individual page inherit it: ------------------------------------------------- maintemplate.html: <html> <body> {% block content %}{% endblock %} </body> </html> ------------------------------------------------- flashpage.html: {% extends "maintemplate.html" %} {% block content %} <script type=javascript src=file.js></script> <object flash bla bla> </object> {% endblock %} ------------------------------------------------- That said, if that doesn't answer your question or it's not clear to you, my apologies and don't hesitate to question more. Cheers, Teren On Nov 5, 4:26 am, Ellen <flusurv...@gmail.com> wrote: > Dear all, > > I am just learning the ropes of django so please direct me to a better > place if my question has been asked a million times before or plain > ridiculous. > > I am managing a website that uses the django platform -- I am not > responsible for building it from scratch so the basic functionality is > already there, but I am managing the database, customising the css, > templates and adding content etc. My programming knowledge is fairly > basic, but not nothing... > > My question is: > I would like to add bits of javascript to individual pages on the > site, such as heatmaps and polymaps, interactive google gadgets, some > movies and also some games written in flash. > With our old site, I would just insert the standard <script.... into > the html. > > How do I insert these kind of things into the django-based site? > -I have tried pasting them into the html box of a text widget via the > django admin page without success > -I have also tried adding them to a base_x.html file with their own > css but this seems to overwrite the base template and fill the whole > browser and so doesn't fit in with the site. > > -Do I need to create a base_x.html template for each jscript I wish to > include? i.e. one for games, one for maps, one for interactive > gadgets? > or do I need to add a django widget that deals with jscript? > or is it not possible to dynamically add bits of code here and there? > > Thanks very much in advance! > > Ellen -- 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.