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

[4.x] Makes using the Icon fieldtype with the SVG tag simpler #8815

Merged
merged 3 commits into from
Oct 9, 2023
Merged

[4.x] Makes using the Icon fieldtype with the SVG tag simpler #8815

merged 3 commits into from
Oct 9, 2023

Conversation

JohnathonKoster
Copy link
Contributor

This PR makes using the Icon fieldtype with the svg tag simpler.

The first change addresses an issue when using the icon fieldtype with its default configuration. Doing so will use the SVGs within Statamic's resources/svg/icons/regular directory. These are visible within the Control Panel, but since that path was not available within the SVG tag's cascade list, you couldn't actually render them like so:

{{ svg src="{field_name | raw}" class="h-4 w-4" /}}

The second change drops the requirement for using the raw modifier, and allows the SVG tag to be used directly on SVG strings, without requiring the input to be a file reference:

{{ svg :src="field_name" class="h-4 w-4" /}}

@jasonvarga jasonvarga merged commit 20f159e into statamic:4.x Oct 9, 2023
16 checks passed
@jasonvarga jasonvarga deleted the improve-icon-field-compatibility-with-icon-fieldtype branch October 9, 2023 20:03
@jasonvarga jasonvarga restored the improve-icon-field-compatibility-with-icon-fieldtype branch October 9, 2023 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants