Drupal 양식 API의 select 요소에 이미지를 표시하는 방법을 알고 싶습니다.drupal의 select 요소 (양식 API) 7 작은 이미지를 표시하는 방법
다음 코드는 "-34-", "-36-"의 두 가지 옵션이있는 간단한 선택을 보여줍니다.
$sizes = array_combine(array(34, 36), array("-34-", "-36-"));
$form['editplayer']['clothes_size_female']['clothes'] = array(
'#type' => 'select',
'#default_value' => 34,
'#options' => $sizes,
);
이미지 경로를 지정하려고했지만 문자열로 간주합니다. $sizes = array_combine(array(34, 36), array("http://localhost/drupal/renderImage.php?user_id=34", "http://localhost/drupal/renderImage.php?user_id=36"));
drupal7에 대한 내 양식 요소 작성 방법은 어디에서 읽을 수 있습니까? 이미 하나의 기사를 알고 있지만, 나는 거기에 쓰여진 것을하려고 할 때 아무 것도 얻지 못했다. (오류도 출력도 없다) http://www.akchauhan.com/create-drupal-form-elements-like-date-element/ – Alex
방금 설명했는데 그 튜토리얼은 이전 버전의 Drupal 용입니다. 하나는 Drupal 7에서 hook_element를 hook_element_info()로 변경했습니다.이 링크에서 정보 읽기 - http://drupal.org/node/966550 또한 hook_theme 및 hook_element_info를 변경할 때 캐시를 비우는 것을 잊지 마십시오 이 물건이 캐시되면서. – mattacular