Skip to content

Layout overriding block with inline #300

@fhogberg

Description

@fhogberg

Tried using a layout inheritance and defining blocks inline.
Am i doing something wrong or is this currently not supported?

        public void PartialLayoutAndInlineBlock()
        {
            string layout = "{{#>body}}{{fallback}}{{/body}}";
            string page = @"{{#>layout}}{{#*inline ""body""}}{{truebody}}{{/inline}}{{/body}}{{/layout}}";


            var template = Handlebars.Compile(page);

            var data = new
            {
                fallback = "aaa",
                truebody = "Hello world"
            };

            using (var reader = new StringReader(layout))
            {
                var partialTemplate = Handlebars.Compile(reader);
                Handlebars.RegisterTemplate("layout", partialTemplate);
            }
            var result = template(data);
            Assert.Equal("Hello world", result);
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions