oTree Forum >

Adding code within html page's <head>

#1 by akashsd

Hi,

I want to add the FB pixel to the landing page of my otree experiment. This involves adding a code snippet within the <head> </head> on the landing HTML page for my experiment. 

I added my code snippet within the {{ block title}}...{{endblock }} but that puts the code snippet in the <body> and not the <head> of the HTML. (see screenshot)

My question is how can I add a code snippet within <head> </head> using django.


Thanks!

#2 by yshimod

If you put your code in {{ block styles }} {{ endblock }},
it will be inserted into the <head> element when rendering
(but this may not be the way Chris intended).

#3 by akashsd

Thanks a lot! 
This solves the issue for me :)

Write a reply

Set forum username