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

Document new attribute modifier #1296

Closed
potsky opened this issue Mar 27, 2024 · 1 comment
Closed

Document new attribute modifier #1296

potsky opened this issue Mar 27, 2024 · 1 comment
Labels
Pending PR Merge Should only be merged after the Core PR has also been merged.

Comments

@potsky
Copy link

potsky commented Mar 27, 2024

Goes along with statamic/cms#9796

Hint for the documentation ;-)


id:
blueprint: modifiers
modifier_types:

  • markup
    title: Attribute

Attribute modifier conditionally renders the parameter that corresponds to the given value, but only when this provided value is not empty.

For example:

---
var: text-pink-500 bg-yellow-200
---

<span{{ view:var | attribute:class }}>Statamic</span>

returns:

<span class="text-pink-500 bg-yellow-200">Statamic</span>

But

---
var: 
---

<span{{ view:var | attribute:class }}>Statamic</span>

will returns:

<span>Statamic</span>
@duncanmcclean duncanmcclean added the Pending PR Merge Should only be merged after the Core PR has also been merged. label Mar 27, 2024
@duncanmcclean
Copy link
Member

Documented in ba2ea9e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pending PR Merge Should only be merged after the Core PR has also been merged.
Projects
None yet
Development

No branches or pull requests

2 participants