안녕하세요 저는 Drupal로 새 사이트를 개발 중입니다. 어떤 이유로 Drupal에서 렌더링하는 입력 검색 필드 앞에 범위 또는 레이블 (<span> 선호)을 추가하고 싶습니다.
그것을 달성하는 방법이 있습니까? 핵심 파일을 수정하는 것이 정말 마음에 들지 않습니다.
어떤 도움을 주시면 감사하겠습니다.
Drupal 버전 : 7
hook_form_BASE_FORM_ID_alter () 후크를 사용하여 기존 마크 업에 HTML을 추가 할 수 있습니다.
/**
* Implements hook_form_BASE_FORM_ID_alter();
*/
function <MODULE_NAME>_search_block_form_alter(&$form, &$form_state, $form_id) {
//Reffer prefix from the api to add <span> or <label>
// https://api.drupal.org/api/drupal/developer%21topics%21forms_api_reference.html/7#prefix
// Reffer prefix from the api to add </span> or </label>
//https://api.drupal.org/api/drupal/developer%21topics%21forms_api_reference.html/7#suffix
}
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다