Skip to content

make content of {embed} available #417

Description

@hengeb

Thank you for this great templating engine, I love it!

It would be great if we could have something like this:

{define myblock, $var}
    some markup
    {$var}
    some more markup
    {block content}default content{/block}
    some other markup
{/define}

{embed myblock, "hello"}
    world
{/embed}

Note: "world" is not wrapped in a {block content} tag.

This should render as:

    some markup
    hello
    some more markup
    world
    some other markup

Here, content is used as a keyword (maybe something like __content is better to avoid conflicts).

With the current version of latte I have to wrap "world" in a block which makes templates harder to read.

Regards,
Henrik

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions