Skip to content

Suggestions for template variables using the |default filter #30

@wgordon17

Description

@wgordon17

I have a whole bunch of templates that rely on the "empty resolves to false" behavior. Specifically setting some HTML class attribute defaults

class="{{height|default:'h-5'}} {{width|default:'w-5'}} {{color|default:'text-blue-500'}}"

Just wondering if you have any suggestions on

  • How to do this "properly" so that it doesn't run afoul of your package
  • Configuring your package so it doesn't yell at me
  • Other ideas? ¯\_(ツ)_/¯

I like the other protections from gotchas that fastdev provides, just this one little nuance that has me disabling it for now 😞

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions