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

Support content_for "block" named argument completion #570

Open
Tracked by #545 ...
charlespwd opened this issue Nov 7, 2024 · 1 comment
Open
Tracked by #545 ...

Support content_for "block" named argument completion #570

charlespwd opened this issue Nov 7, 2024 · 1 comment
Assignees
Labels

Comments

@charlespwd
Copy link
Contributor

charlespwd commented Nov 7, 2024

This one is a bit harder because you need to change the parser and accept placeholder args in placeholder mode.

I'll leave that one for our team.

We want named argument completion:

{% content_for "block", █ %} -> `type`, `id`
{% content_for "block", ty█ %} -> `type`
{% content_for "block", i█ %}  -> `id`

Optional: complete closest.* arguments. Ask @mbarak for details :D

{% content_for "block", closest.█ %} -> `closest.product`, ...

Note

content.* is changing to closest.* after BFCM code freeze is lifted.

@mbarak
Copy link

mbarak commented Nov 7, 2024

"context" attributes are also supported in {% content_for "blocks" %} (blocks plural as opposed to block singular in the description). This variant doesn't accept id and type arguments but does support "context" attributes/arguments (like the singular block variant).

The supported context arguments are:

  • context.<core_resource> ex: context.product
  • context.metaobject.<metaobject type> ex: context.metaobject.123-metaobject_type

See here for more details:

https://github.com/Shopify/shopify/blob/9656f8a63a44c4be1d63f68a28bd3af109e5ecd0/areas/core/shopify/components/online_store/app/liquid/tags/content_for/block_strategy.rb#L9-L17

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

No branches or pull requests

3 participants