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

Kukhar Vasily Matthew Weier O'Phinney
Kukhar Vasily

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>
Matthew Weier O'Phinney

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.

Kukhar Vasily

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.

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

I've confirmed the issue.

Matthew Weier O'Phinney weierophinney referenced this issue from a commit
Matthew Weier O'Phinney 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
Matthew Weier O'Phinney

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.