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

Docs about partial modifier outdated #1446

Open
carstenjaksch opened this issue Aug 31, 2024 · 1 comment
Open

Docs about partial modifier outdated #1446

carstenjaksch opened this issue Aug 31, 2024 · 1 comment
Labels
Outdated Fixes issues with docs becoming outdated or stale.

Comments

@carstenjaksch
Copy link

carstenjaksch commented Aug 31, 2024

I tried to use the partial modifier, but there are several issues:

  1. The docs page mentions themes, that are outdated since v3.
  2. It does not work. I need to pass key-value-pairs of an array as variables to a partial. But the partial does not load – neither hard-coded nor dynamic.

This is my use-case (page_builder/_article.antlers.html from Peak starter, a Bard field):

{{ articleRaw = article | raw }}

{{ articleRaw }}
  {{ values = attrs:values }}

  {{ values | partial("components/{values:type}") }}
  {{# ... or hardcoded ... #}}
  {{ values | partial('components/pull_quote') }}
{{ /articleRaw }}

I am on Statamic 5.23.0 by the way.
Docs page: https://statamic.dev/modifiers/partial

@carstenjaksch
Copy link
Author

carstenjaksch commented Aug 31, 2024

Found a thread about the same topic in Discord, if that adds helpful context.

I think the issue here is that the partial modifier assumes the partials in a resources/partials sub-directory – other than the partial tag, which resolves the path relative to the resources/views directory.

So this issue needs a fix both from the docs and cms side of Statamic, I think.

@duncanmcclean duncanmcclean added the Outdated Fixes issues with docs becoming outdated or stale. label Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Outdated Fixes issues with docs becoming outdated or stale.
Projects
None yet
Development

No branches or pull requests

2 participants