建站代码网

热门标签

phpcms v9将栏目描述的多行文本修改为编辑器的方法

phpcms v9默认栏目描述为多行文本,无法添加图片、样式等,那么如何将它修改为编辑器呢?

添加栏目时将栏目描述多行文本修改为编辑器的方法:
打开 phpcms/moudles/admin/templates/category_add.tpl.php 文件
找到(80行左右)
<textarea name="info[description]" maxlength="255" style="width:300px;height:60px;"><?php echo $description;?></textarea>
修改为
<script type="text/javascript" src="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20480%20640'%3E%3C/svg%3E" loading='lazy' data-lazy-src="http://1.com/skin/default/image/nopic.gif"><textarea name="info[description]" cols="50" rows="8" id="content"><?php echo $description;?></textarea>
<script type="text/javascript">
CKEDITOR.replace( 'content',{height:100,width:400,pages:false,subtitle:false,textareaid:'content',module:'',catid:'',
flashupload:true,alowuploadexts:'',allowbrowser:'1',allowuploadnum:'10',authkey:'c8e07e653e467f2f1b2058ee44db799c',
filebrowserUploadUrl : '/index.php?m=attachment&c=attachments&a=upload&module=&catid=&dosubmit=1',
toolbar :
[
['Source'],['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'link', 'Unlink' ],['Maximize'],    //这是工具列表
]
});
</script>

更新缓存即可

修改栏目时将栏目描述多行文本修改为编辑器的方法:
提示:方法与"添加栏目时将栏目描述多行文本修改为编辑器"相同
打开 phpcms/moudles/admin/templates/category_edit.tpl.php 文件
找到(70行左右)
<textarea name="info[description]" maxlength="255" style="width:300px;height:60px;"><?php echo $description;?></textarea>
修改为
<script type="text/javascript" src="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20480%20640'%3E%3C/svg%3E" loading='lazy' data-lazy-src="http://1.com/skin/default/image/nopic.gif"><textarea name="info[description]" cols="50" rows="8" id="content"><?php echo $description;?></textarea>
<script type="text/javascript">
CKEDITOR.replace( 'content',{height:100,width:400,pages:false,subtitle:false,textareaid:'content',module:'',catid:'',
flashupload:true,alowuploadexts:'',allowbrowser:'1',allowuploadnum:'10',authkey:'c8e07e653e467f2f1b2058ee44db799c',
filebrowserUploadUrl : '/index.php?m=attachment&c=attachments&a=upload&module=&catid=&dosubmit=1',
toolbar :
[
['Source'],['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'link', 'Unlink' ],['Maximize'],    //这是工具列表
]
});
</script>

更新缓存即可
X