jade / express - when to use or not to use layouts -


i've started developing in express , new jade well.

i'm having trouble deciding when it's appropriate use layouts , when not to. i'm having trouble deciding when it's appropriate use blocks vs. partials.

any regarding appreciated. i'm little lost.

it's matter of preference. if used wordpress have concept of header , footer include pages might not layouts. use layouts content blocks because non-layout way tends cause more repetition.

as partials vs blocks. use partial items want reuse on different pages. while block chunk of html replaced child templates.

an example of partial can html product. have thumbnail, title , description of product. might use partial while listing products in category. might use partial rendering list of search results.

an example of partial can main layout contains header , navigation , content area. if want reuse main layout on multiple pages extend , overwrite block in child templates.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -