Skip to content

Change __pattern_library_view to is_pattern_library and make it an official "API" #156

Closed
@zerolab

Description

@zerolab

Is your proposal related to a problem?

There are cases when it comes handy to check whether a pattern is displayed in the pattern library or is an actual page.

We have __pattern_library_view in the context, however you cannot use it like {% if __pattern_library_view %} because TemplateSyntaxError: Variables and attributes may not begin with underscores: '__pattern_library_view'

Describe the solution you'd like

Change __pattern_library_view to is_pattern_library in the context

Describe alternatives you've considered

My workaround was to add a dummy variable in the yaml and use that

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions