0

I am trying to use Bootstrap within the Eliom framework but I cannot figure out how to use some of the html attributes correctly. Take for example the following code from the bootstrap website (http://getbootstrap.com/components/#btn-groups):

<div class="btn-group" role="group" aria-label="...">
<button type="button" class="btn btn-default">Left</button>
<button type="button" class="btn btn-default">Middle</button>
<button type="button" class="btn btn-default">Right</button>
</div>

I cannot figure out how to replicate the attributes role and aria-label in Eliom. They are not listed under type base_attributes, type button_attrib or type common (http://ocsigen.org/tyxml/3.4/api/Html5_types#TYPEcommon). Can the above code be replicated in Eliom?

Thomas
  • 347
  • 3
  • 19
  • Also not familiar with Eliom, but most frameworks don't **force** you to use their markup. I know with Laravel and CakePHP, you can use their `Form::create` helper classes to make forms, or you can code it manually as `
    ...
    `. Are you unable to do this is Eliom?
    – Tim Lewis Dec 24 '14 at 19:03

2 Answers2

3

A binding was started here.

As ckuijjer said, the Unsafe module is the right way to add non-existent attributes/elements. The one that are missing should be contributed to tyxml, of course. :)

Drup
  • 3,679
  • 13
  • 14
2

The role and aria-... attributes are used to give hints to enhance accessibility for people with disabilities (see this ARIA article at MDN). Depending on the accessibility requirements you must decide if you need them, Bootstrap's styling and JavaScript components aren't dependent on them.

Looking at the Ocsigen FAQ (look for "Some HTML5 element or attribute is missing. What can I do?") it seems that if you use the TyXML library you can use the low unsafe interface Html5_sigs.​T.​Unsafe. But frankly I don't know anything about Eliom.

ckuijjer
  • 13,293
  • 3
  • 40
  • 45