DUXCMS这款内容管理系统其实挺不错的,相信挺多人也在用,今天,我们分享一个小技巧,就是让栏目的高级属性中的SEO内容框可以支持编辑器编辑,我们看一下截图。
程序默认的界面
我们修改后的界面
好了,我们开始修改,影响文件为/admin/template/content_category/info.html。
我们把光标定位到第80行,把以下代码
<tr class="advanced">
<td width="100" align="right">SEO内容</td>
<td><textarea name="seo_content" class="text_textarea" id="seo_content">{$info.seo_content html}</textarea>
</td>
<td>可以填写HTML代码</td>
</tr>
修改为
<tr class="advanced">
<td colspan="3">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="100" align="right">SEO内容</td>
<td>
<?php echo module('editor')->get_editor('seo_content'); ?>
<textarea name="seo_content" class="text_textarea" style="width:100%; height:350px;" id="seo_content">{$info.seo_content html}</textarea>
<input type="button" onclick="javascript:get_remote_image()" style="margin-top:10px;" class="button_small" value="远程图片本地化" />
<!--hook-->
<?php module('common')->plus_hook('seo_content','tools'); ?>
<!--hook end-->
</td>
<td>可以填写HTML代码</td>
</tr>
</tbody>
</table>
</td>
</tr>
然后在最后面加上下面的代码即可。
<script type="text/javascript">
$(document).ready(function(){
get_fields();
});
//TAG
$('#keywords').tagsInput(
{
'defaultText':'关键词会转为tag'
});
function get_remote_image(){
ajaxpost_w(
'__APP__/editor/get_remote_image',
{content:editor_content.html()},
2,
function(msg){
editor_content.html(msg);
},
function(){
},
'远程抓图执行完毕'
);
}
</script>
这样我们就完成了,而且还可以把远程的图片本地化噢!怎样,不错吧!