0

is there a way to display a single_select in sulu admin as select box instead of a radio input?

I have a definition like this:

<property name="imagePosition" type="single_select" colspan="6">
    <params>
        <param name="values" type="collection">
            <param name="left">
                <meta>
                    <title lang="en">Left</title>
                </meta>
            </param>
            <param name="right">
                <meta>
                    <title lang="en">Right</title>
                </meta>
            </param>
            <param name="top">
                <meta>
                    <title lang="en">Top</title>
                </meta>
            </param>
            <param name="bottom">
                <meta>
                    <title lang="en">Bottom</title>
                </meta>
            </param>
            <param name="afterHeadline">
                <meta>
                    <title lang="en">After Headline</title>
                </meta>
            </param>
        </param>
    </params>
</property>

Maybe something like <param name="values" type="collection" input="select">?

Thx a lot! Andreas

Andreas
  • 1,691
  • 1
  • 15
  • 34

2 Answers2

1

You can create you custom template for rendering single_select type and specify this template in SuluContentBundle configuration

sulu_content:
    types:
        single_select:
            template: 'AppBundle:admin:single_select.html.twig' 

More detailed instruction: Display single_select as select instead of radio input on Sulu admin

0

That is not implemented yet... So I am afraid to say that this is not working :-/

Daniel Rotter
  • 1,998
  • 2
  • 16
  • 33
  • No worries - if I find some time I'll create a PR for that, probably as `` with default radio? – Andreas Oct 29 '18 at 11:04
  • There was also the suggestion to create an own content type based on 'single_select' but with your ones own twig template. In case somenody needs this urgently – Andreas Jan 25 '19 at 14:38