Skip to content

Extend partials #346

@norlin

Description

@norlin

For example, I have little html-snippet

<div class="my-little-block">
    <h3 class="title">{title}</h3>
    <div class="little-block-content">{content}</div>
</div>

How I could reuse this snippet in my template?
E.g., I need template like this:

{?dust}
<div class="my-little-block">
    <h3 class="title">My first block</h3>
    <div class="little-block-content">
        <div>...more html with {some} {params}...</div>
    </div>
</div>
{:else}
<div class="my-little-block">
    <h3 class="title">Look ma, table!</h3>
    <div class="little-block-content">
        <table>some other html {with} {different} {data}</table>
    </div>
</div>
{/else}

And I want not to copy-paste html-layout for my little block, but use some partial with it. Now I can't do this...

Something like this:

{?cond}
    {>myLittleBlock}
        {<title}My first block{/title}
        {<content}
            <div>...more html with {some} {params}...</div>
        {/content}
    {/myLittleBlock}
{:else}
    {>myLittleBlock}
        {<title}Look ma, table!{/title}
        {<content}
            <table>some other html {with} {different} {data}</table>
        {/content}
    {/myLittleBlock}
{/cond}

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