MK
unread,May 21, 2011, 7:32:31 AM5/21/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Express
I have a template that is a whole page. I have another template that
is a fragment of a page, ie, a partial.
I would like to include the partial in the page, so in the "parent"
template I have:
<%=partial('file', {})=%>
In my experience, this is a pretty basic, more or less definitive, use
of "partials" -- rather than having to repeat a fragment in several
different templates, I just include one within the other.
But absurdly enough (IMO), with express html tags in this html partial
are then parsed into < and >. In other words, express is
treating this exactly the same as if I had replaced the partial() call
in the parent with a variable named "here" and done this:
var html = fs.readFileSync('file');
res.render('parent', {
here: html,
}
Is there a way I can turn off the tag parsing? Or something?