-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sugar syntax for layout and partials #102
Comments
Alou? |
@kirbysayshi are you there? |
You should read the vash document first,Layout Helpers has a detailed description |
Sure @bishanshan, it explains how to use the layout helpers using a sintax regard with jade templates. However, the main idea here is to use layout helpers with Asp.Net style that is explained above. You can notice the way to import templates is different as the docs says. |
I'm interested in this too. Or rather, more generally interested why the tagline for vash says
But when one gets going with it, one quickly discovers the more jade-like patterns and noted lack of more Razor style directives ? As an example, I was attempting to approximate a Razor template from an asp*net mvc project that uses vash.config.helpersName = 'Html'
/**
* Facade for Razor's .Partial()
*/
vash.helpers.Partial = function(viewName, viewBag) {
return this.include( viewName, viewBag )
}
// now I can use @Html.Partial('my/view', myData) ... this is in a tiny expressjs setup, where I am only using express to bootstrap and compile/render my vash templates. Disclosure: I've used plenty of other templating engines, but both vash and Razor are relatively new to me, so forgive me if this has been covered before/elsewhere. |
Hi, as the title says it'd be great to have some sugar syntax to render a layout of a partial view in vash. For example, I'd call a view with res.render and then specify a layout like this:
And the way to import a partial view would be:
@RenderPartial("content")
And from the layout we can do this:
@RenderBody()
Including some sections
@RenderSection("foo")
And the way to specify sections:
This is how ASP.NET MVC razor syntax does, it'd be great if this is implemented and one suggestion to render content to it.
The text was updated successfully, but these errors were encountered: