ericf / express-handlebars

A Handlebars view engine for Express which doesn't suck.
BSD 3-Clause "New" or "Revised" License
2.31k stars 384 forks source link

Passing other variables to layout than body? #45

Closed pyryson closed 10 years ago

pyryson commented 10 years ago

I have a site that has fb's og-tags in head-section which should be able to be modified according to content that comes out from mongoose model and also urls containing information of current page, like searched category or tag for example.

In general I mean all kinds of dynamic data that varies with users search terms, simplest example would be title-tag changing according to search query.

Hope you got the point!

How should I approach this problem using express3-handlebars?

ericf commented 10 years ago

This works out of the box. A layout template receives the same context object (dynamic data) that the view/body template is rendered with.