Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Multiple view nesting #17

Closed
ngreduce opened this Issue · 4 comments

2 participants

@ngreduce

When using hierarhical views. It seems to be limitation: no more than one content-variable.

Example

<div class="row-fluid">
    <div class="span4">{{$sidebar}} {{/sidebar}}</div>
        <div class="span8">
            {{$content}} {{/content}}
    </div>
</div>
@weierophinney

I've added a test case - as see in 8b829b5 - that demonstrates that this works. It's possible that I'm not understanding the full context, however. Please let me know.

@ngreduce

layout.tpl

<div class="container-fluid">
    {{$body}}

    <div class="row-fluid">
        Default content
    </div>

    {{/body}}
</div>

nested/layout.tpl

{{<layout}}
{{$body}}

<div class="row-fluid">
    <div class="span3">
        ....
    </div>
    <div class="span9">
        {{$content}}default content{{/content}}
    </div>
</div>

{{/body}}
{{/layout}}

nested/main.tpl

{{<nested.layout}}
{{$content}}
  new content
{{/content}}
{{/nested.layout}}

outputs: default content
If you still cannot reproduce, I will try to make a test case for that in 4 hours.

@weierophinney weierophinney referenced this issue from a commit
@weierophinney weierophinney [#17] Demonstrate nested content
- First pass test, showing simple example
f31aaf2
@weierophinney weierophinney referenced this issue from a commit
@weierophinney weierophinney [#17] Confirmed issue
- Problem is with nesting children, and defining new placeholders in
  children
61468cd
@weierophinney

I've confirmed the issue.

@weierophinney weierophinney referenced this issue from a commit
@weierophinney weierophinney [#17] Properly nesting views for inheritance
- Modified lexer logic to better ensure merging of placeholders from
  child to parent so that substitutions happen appropriately.
4919ba6
@weierophinney

Fixed in 4919ba6 -- please test!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.