Thứ Sáu, 11 tháng 4, 2014

Module add Field Editor not remove HTML

Mô tả: thêm field dạng textarea có load editor để dễ dàng  hiệu chỉnh html.
file hiệu chỉnh: root/modules/mod_name/ ... .xml

Thêm vào :
<field filter="raw" name="textarea" type="editor" default="" label="View text area" description="View text area top module" />

ý nghĩa: filter="raw" joomla sẽ giữ lại cấu trúc html. Nếu ko có dòng filter="raw" thì clear html, lúc này chỉ dạng text ko có cấu trúc ko có style.

Lúc load lên trong folder view:
if($params->get('textarea')){
            echo '<div class="textareaTop">'.$params->get('textarea').'</div>';
}

0 nhận xét:

Đăng nhận xét