Content Taxonomy와 Active Tags Popular의 동시사용은 요원한가?
컨텐츠 택소노미(Taxonomy, 분류학이라는 의미)는
컨텐츠 타입의 특정 필드를 Vocabulary로 치환 가능한 모듈이다.
Active Tags Popular 모듈은
액티브 태그 모듈을 더욱 더 편하게 사용토록 후보 텀즈를 표시해 주는 것이다.
(팔팔의 관련 글 참고)
특정 컨텐츠에 드루팔의 택소노미 기능으로 텀즈(태그, 카테고리)를 배당할 수 있는데,
이때 손으로 일일이 입력하는 것이 귀찮고 힘들기 때문에 AutoComplete기능을 이용,
텀즈 후보가 미리 보이도록 하는 것이 좋다. 이 과정을 더욱 더 편하게 해 주는 것이
액티브 태그 포퓰러 모듈로 텀즈에 적합한 후보 태그들을 미리 나열해 보여 준다.
이 모듈은 2012년 3월 현재 아직 Content Taxonomy 모듈과 연동하지 않는데,
Content Taxonomy 모듈은 Active Tags 와는 연동한다.
(참고로 Active Tags Popular 모듈은 액티브태그의 내장-하위 모듈이다)
억지로 연동하고 싶은 경우라면, 아래 주소의 패치를 이용해서 고칠 수도 있다.
하지만 세부적인 버전의 차이에 따라 작동하지 않을 수도 있다.
Content Taxonomy » Issues » Active Tags Popular support
http://drupal.org/node/560722
위 글의 #2 패치의 내용을 기재해 둔다.
(http://drupal.org/files/issues/patch_75.patch)
--- content_taxonomy_autocomplete.module 2009-08-19 04:42:30.000000000 -0500
+++ content_taxonomy_autocomplete.module 2009-08-31 13:15:20.000000000 -0500
@@ -92,10 +92,26 @@ function content_taxonomy_autocomplete_w
'#description' => t('Use the Active Tags module to improve the usability of this autocomplete widget.'),
);
}
+ if (module_exists('active_tags_popular')) {
+ $form['autocomplete']['active_tags_popular'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Active Tags Helper - Popular'),
+ '#weight' => 11,
+ '#default_value' => isset($widget['active_tags_popular']) ? $widget['active_tags_popular'] : 0,
+ '#description' => t('Adds additional helpers to the active tags widget to assist in adding popular tags to posts'),
+ );
+ $form['autocomplete']['active_tags_popular_no'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Number of popular tags to show'),
+ '#weight' => 12,
+ '#size' => 20,
+ '#default_value' => isset($widget['active_tags_popular_no']) ? $widget['active_tags_popular_no'] : 10,
+ );
+ }
return $form;
case 'save':
- return array('new_terms', 'extra_parent', 'maxlength', 'active_tags');
+ return array('new_terms', 'extra_parent', 'maxlength', 'active_tags', 'active_tags_popular', 'active_tags_popular_no');
}
}
@@ -104,6 +120,10 @@ function _content_taxonomy_autocomplete_
if (!is_numeric($value) || intval($value) != $value || $value <= 0) {
form_error($element, t('"Maximum length" must be a positive integer.'));
}
+
+ if (module_exists('active_tags_popular') && $element['#post']['active_tags_popular']) {
+ variable_set('active_tags_popular_no_'.$element['#post']['vid'], $element['#post']['active_tags_popular_no']);
+ }
}
/**
@@ -173,7 +193,7 @@ function content_taxonomy_autocomplete_p
$field_name = $element['#field_name'];
$field = $form['#field_info'][$field_name];
$field_key = $element['#columns'][0];
-
+ $vid = $element['#vid'];
$element[$field_key] = array(
'#type' => 'textfield',
'#default_value' => isset($element['#value'][$field_key]) ? $element['#value'][$field_key] : '',
@@ -197,6 +217,12 @@ function content_taxonomy_autocomplete_p
active_tags_enable_widget('#' . $element['#id'] . '-value-wrapper');
}
+ if (module_exists('active_tags_popular') && $field['widget']['active_tags_popular']) {
+ active_tags_popular_enable_widget('#active_tags_popular'.$vid.'-'.$element['#id'].' '.'#' . $element['#id'] . '-value-wrapper');
+ $element['#prefix'] = '<div id="active_tags_popular'.$vid.'-'.$element['#id'].'">';
+ $element['#suffix'] = '</div>';
+ }
+
return $element;
}
- Login to post comments
최근 댓글 목록
1 년 22 주 전
1 년 22 주 전
3 년 49 주 전
3 년 50 주 전
6 년 36 주 전
6 년 36 주 전
6 년 37 주 전
6 년 37 주 전
7 년 5 주 전
7 년 12 주 전