Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
zerolab opened this issue Nov 3, 2021 · 0 comments · Fixed by #167
Closed

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

zerolab opened this issue Nov 3, 2021 · 0 comments · Fixed by #167
Labels
enhancement New feature or request
Milestone

Comments

@zerolab
Copy link
Member

zerolab commented Nov 3, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants