0

I have done the following:

mixin article(newTitle)

#title
    if (newTitle)
        newTitle
    else
        block article-block-title
#content
    if block
        block
    else
        block article-block-content

block article-block-title
    Default  title text

block article-block-content
    Default  content text

So I can use this on my homepage like

+article //Will render the Default article

+article // Should render default title and new content
    p Some more content

+article("New Title") // Should render the new title and the default content

+article("New Title and Content") // Should render a new article
    p Some more content

But it's not working. The Default values are never rendered, only the block is. Neither the new title passed in is working. Any clues?

1 Answer 1

0

As I know, you can override Blocks only by extending templates. You should declare default values directly:

mixin article(newTitle)

    #title
        if (newTitle)
            newTitle
        else
            Default title text

    #content
        if block
            block
        else
            p Default content text

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.