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

Add dynamic placeholder theme #147

Open
alexander-schranz opened this issue Mar 16, 2018 · 0 comments
Open

Add dynamic placeholder theme #147

alexander-schranz opened this issue Mar 16, 2018 · 0 comments
Labels

Comments

@alexander-schranz
Copy link
Member

alexander-schranz commented Mar 16, 2018

Q A
Bug? no
New Feature? yes
Bundle Version 1.0.0-RC3

Actual Behavior

Actually there is no theme where the labels are set as input.

Expected Behavior

There should be set a theme where the labels are set as inputs

Possible Solutions

{% extends 'SuluFormBundle:themes:dynamic.html.twig' %}

{%- block form_row -%}
    {{ block('sulu_form_row_start') }}
    {{- form_label(form, null, {label_attr: { class: 'sr-only' }} ) -}}
    {{- form_errors(form) -}}
    {{- form_widget(form, { attr: { placeholder: label|strip_tags } }) -}}
    {{ block('sulu_form_row_end') }}
{%- endblock -%}

{%- block choice_row -%}
    {{ block('sulu_form_row_start') }}
    {{- form_label(form) -}}
    {{- form_errors(form) -}}
    {{- form_widget(form) -}}
    {{ block('sulu_form_row_end') }}
{%- endblock -%}

{%- block checkbox_row -%}
    {{ block('sulu_form_row_start') }}
    {{- form_errors(form) -}}
    {{- form_widget(form) -}}
    {{- form_label(form) -}}
    {{ block('sulu_form_row_end') }}
{%- endblock -%}

You need to add a .sr-only class for accessibility. ( http://a11yproject.com/posts/how-to-hide-content/ )

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

1 participant