I came across this problem while working on #2731, where I needed to target some form elements in CSS. This turned out to not be as easy as expected, because the names of the form elements were too generic (like label
, delta
, and description
). The requirement was to add more specific classes to the wrapper <div>
s of the form elements.
I will explain in code examples, but instead of using the code in that specific use case, I will use more simplified and generic examples. So say you have this form definition:
$form['parent'] = array(
'#parents' => array(),
);
$form['parent']['checkbox'] = array(
'#type' => 'checkbox',
'#title' => t('Do something'),
);
$form['parent']['textfield'] = array(
'#type' => 'textfield',
'#title' => t('Enter some text'),
);
This will produce the following code:
<form class="some-form" id="some-form" >
<div>
<div class="form-item form-type-checkbox form-item-checkbox">
<label class="option" for="edit-checkbox">Do something </label>
<input type="checkbox" id="edit-checkbox" name="checkbox" class="form-checkbox">
</div>
<div class="form-item form-type-textfield form-item-textfield" >
<label for="edit-textfield">Enter some text </label>
<input type="text" id="edit-textfield" name="textfield" class="form-text">
</div>
</div>
</form>
...
Recent comments
https://www.drupal.org/project/views/issues/1266388 shows that this is an architectural issue, and requires another 2 hooks being adjusted. It would be really nice to add comments/notes to...
node access
Hmmm, from D7 ancient tomes: from https://drupal.stackexchange.com/questions/7056/limit-which-roles-can-view-a-node-basing-on-its-content-type yet https://docs.backdropcms.org/api/...
node access
I also note on this screen: "Furthermore note that content which is not published is treated in a different way by Backdrop: it can be viewed only by its author or users with the...
node access