Bu alanın (tam olarak dosya alanı) yardım metninin bir parçası olarak bir form alanı altında basit bir tablo görüntülemek istiyorum. Tamamen zihinsel miyim yoksa bu metin alanı için izin verilen html etiketlerini değiştirmenin gerçekten kolay bir yolu yok mu? Şu an gösterdim:
Instructions to present to the user below this field on the editing form.
Allowed HTML tags: a b big code del em i ins pre q small span strong sub sup tt ol ul li p br img
Kolay bir yol yoksa, bunu yapmanın bir sonraki en kolay yolu nedir?
GÜNCELLEME:
Clive, bunu özel bir modülle aşağıda yapmanın harika bir yolunu buldu. Yardım metnini aşağıdaki gibi katlanabilir yapmak için ctools'u kullanarak buna da ekleyebilirsiniz:
// Implement hook_field_widget_form_alter()
function MYMODULE_field_widget_form_alter(&$element, &$form_state, &$context) {
// If some condition is matched based on the element provided...
if (isset($element[0]) && $element[0]['#field_name'] == 'field_test') {
// Alter the description using your more permissive set of tags
$reworked = filter_xss($context['instance']['description'], _MYMODULE_field_filter_xss_allowed_tags());
$element[0]['#description'] = theme('ctools_collapsible', array('handle' => 'Help text', 'content' => $reworked, 'collapsed' => TRUE));
}
}
// Provide a more permissive set of tags to be used with filter_xss()
function _MYMODULE_field_filter_xss_allowed_tags() {
// Merge the new set of allowed tags with the less permissive defaults
$new_tags = array('table', 'thead', 'tbody', 'tfoot', 'tr', 'th', 'td');
return array_merge(_field_filter_xss_allowed_tags(), $new_tags);
}