Skip to content
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

Partials with block content #35

Open
laurie71 opened this issue Aug 15, 2011 · 0 comments
Open

Partials with block content #35

laurie71 opened this issue Aug 15, 2011 · 0 comments

Comments

@laurie71
Copy link

The peg grammar treats partials differently from other sections, requiring the 'partial' tag to be self-closing, so it isn't valid to do

{>partial}...stuff...{/partial}

Could support for this be added, along with blocks, so you could write, for example:

{>partial}
    {<heading}Title{/heading}
    {<content}
        ...markup...
    {/content}
{/partial}

The heading/content sections would remain on the context stack for the duration of partial, then be popped.

This would be a more natural syntax when using inline partials for layout but, more importantly, it would allow partials to be reused within a page for rendering repeating elements with varying content. I'd use this, for example, to standardize how forms are marked up across an app/site whilst keeping the actual form elements local to the calling template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant