Skip to content

Exiting a MACRO early #299

Description

@randyl

Several times I've wanted to exit a MACRO early if some condition is met. I keep thinking RETURN will do this, but it exits the template, not the macro. I guess that works if the macro is in its own template, but many times I have a macro that exists only in the template that uses it.

I'm looking for something like this:

MACRO output_section( value ) BLOCK;
    IF value == 0;
        # display short amount of html for special case
        EXIT;  # exit this macro/block
    END;
    
    # display lots of html for section
END;

# display main html
output_section( 4 );
output_section( 0 );

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions