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

Dynamic icon option for Toggles field is ignored #6780

Closed
philipmarnef opened this issue Nov 4, 2024 · 0 comments
Closed

Dynamic icon option for Toggles field is ignored #6780

philipmarnef opened this issue Nov 4, 2024 · 0 comments
Milestone

Comments

@philipmarnef
Copy link

Dynamic options for a Toggles field work for 'text' and 'value' but the 'icon' key is ignored and only the label text is shown.

Providing an options array in the blueprint with text/value/icon works, doing the same with a query does not.

Kirby 4.1.1
No console errors.

blueprint:

              test1:
                label: Test
                type: toggles
                labels: false
                options:
                  - text: Option 1
                    value: o1
                    icon: text-left
                  - text: Option 2
                    value: o2
                    icon: text-right

              test2:
                label: Test
                type: toggles
                labels: false
                grow: false
                options: 
                  type: query
                  query: page.testArray
                  text: "{{ item.text }}"
                  value: "{{ item.value }}"
                  icon: "{{ item.icon }}"

page method:

'testArray' => function () {
	return [
		[
			'text' => 'Option 1',
			'value' => 'o1',
			'icon' => 'text-left',
		],
		[
			'text' => 'Option 2',
			'value' => 'o2',
			'icon' => 'text-right',
		],
	];
},

Test 1 displays fine, Test 2 shows the (correct) labels instead of Icons

@bastianallgeier bastianallgeier added this to the 4.5.0 milestone Nov 12, 2024
bnomei added a commit to bnomei/kirby3-schema that referenced this issue Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants