{% extends.. block body} is it standard to use or not?
Is it standard to use % extends, block body, end block like in the code below(copied from cs50 video) or is it better to just type out the whole template on each new page with exclamation mark in vs code?
3 Replies
The idea is to avoid having to duplicate all that code on every page, so that if you change something you only have to do it in one place. So yes, use that 🙂
(also, only for future reference, no need to move this one, but this looks like twig? Which is a #back-end templating language, so please post any future questions there right away 🙂 There's no question too small to not go in the appropriate channel)
and to add to what Joao said, yup, that's the entire point of templating and using
extends
they used some flask in cs50, my bad, thanks