================ 模板配置文件包括 ================ source/plugin/yuzhe_page/template/temp/company/%23_common_config.php(发布模板自带,受升级影响) source/plugin/yuzhe_page/template/temp/company/%23_common_config_extra.php(站长自行增加,不受升级影响) source/plugin/yuzhe_page/template/temp/company/企业网站模板目录/common/config.php(发布模板自带,受升级影响) source/plugin/yuzhe_page/template/temp/company/企业网站模板目录/common/config_extra.php(站长自行增加,不受升级影响) ================ 配置格式说明 ================ //temptype可为:computer-电脑模板使用/mobile-手机模板使用 特别注意:调用标签时也要对应 $_YUZHE['template']['temptype']['field'] = array( 'fieldname' => array( //fieldname为字段名称,英文和数字及下划线 'title' => '名称', //字段名称 'tips' => '说明', //字段说明,主要用于设置界面的描述文字 'type' => '类型', //字段类型,可为:text-单行/image-图片/select-下拉单选/selects-下拉多选/radio-单选/checkbox-复选/textarea-多行 //字段选项 //当type为textarea可设置为editor加载编辑器 //当type为text时可设置color时点击输入框可加载调色板 //当type为select/selects/radio/checkbox时设置选择项。格式:array('保存值' => '显示文字', '保存值2' => '显示文字2') 'option' => array( '1' => '选项一', '2' => '选项二', '5' => '选项五', ), 'value' => '默认', //默认值,当type为selects/checkbox时该项值设置为数组,对应option中的保存值,如:'value' => array(1,2) 'script' => 0, //是否允许使用script和style标签,0-不允许,1-允许 'html' => 0, //是否解析html代码,当type不为image/select/selects/radio/checkbox时有效,0-不解析,1-解析 'maxlen' => 长度, //字段长度,当type为text时有效,为input的maxlength值 'config_style' => '样式', //字段输入框的样式代码,直接输入附加代码,如style="float:left;" 'config_header' => '', //自定义用户设置界面顶部,省略该项使用默认<tr><th>标题</th><td> 'config_footer' => '', //自定义用户设置界面底部,省略该项留空使用默认</td></tr> ), 'field2' => array( 'title' => '测试字段2', 'tips' => '设置说明', 'type' => 'text', //.....其他参数这里省略 ), ……………… //更多字段 } ================ 模板调用标签 ================ 1、循环调用 <!--{loop $_YUZHE['template']['computer']['field'] $fvalue}--> $fvalue[title] : {if $fvalue['type'] == 'image'} <img src="$fvalue[valueurl]"> {elseif in_array($fvalue['type'], array('selects', 'checkbox'))} $fvalue[valuetext] {else} $fvalue[value] {/if} <hr> <!--{/loop}--> 2、指定字段调用: $_YUZHE[template][computer][field][字段名称][value] 3、例外: 1、当type为select/selects/radio/checkbox时 $_YUZHE[template][computer][field][字段名称][value]valuetext 显示值,调用: $_YUZHE[template][computer][field][字段名称][valuetext] 2、当type为image时,value的值为上传保存数据库中的图片路径(不是全路径),调用全路径图片标签为valueurl,如: $_YUZHE[template][computer][field][字段名称][valueurl] ================ 设置示例 ================ $_YUZHE['template']['computer']['field'] = array( 'hidden' => array( 'title' => '参数设置', 'tips' => '该字段为', 'type' => 'hidden', 'value' => '针对当前模板的设置', ), 'textfield' => array( 'title' => '单行文本', 'tips' => '这里是单行', 'type' => 'text', 'value' => '单行默认值', 'config_style' => 'style="color:red;width:282px;"', 'maxlen' => 255, ), 'selectfield' => array( 'title' => '单选下拉', 'tips' => '这是单选下拉框', 'type' => 'select', 'option' => array( '1' => '值1', '2' => '值2', ), 'value' => '2', 'config_style' => '', ), 'selectsfield' => array( 'title' => '多选下拉', 'tips' => '这是多选下拉框,按住Ctrl可多选,默认选择1、3', 'type' => 'selects', 'option' => array( '1' => '值1', '2' => '值2', '3' => '值3', ), 'value' => array(1,3), 'config_style' => '', ), 'radiofield' => array( 'title' => '单选按钮', 'tips' => '这是单选按钮', 'type' => 'radio', 'option' => array( '1' => '值1', '2' => '值2', ), 'value' => '2', 'config_style' => '', ), 'checkboxfield' => array( 'title' => '多选按钮', 'tips' => '这是多选按钮,想选哪些点哪些,默认选择2、3、4', 'type' => 'checkbox', 'option' => array( '1' => '选1', '2' => '选2', '3' => '选3', '4' => '选4', ), 'value' => array(2,3,4), 'config_style' => '', ), 'textareafield' => array( 'title' => '多行文本', 'tips' => '这里可以输入多行文本', 'type' => 'textarea', 'value' => '多选文本默认值<br> 我是第二行 我是第三行', 'config_style' => '', ), 'textareafield2' => array( 'title' => '编辑器', 'tips' => '我是变种多行文本,支持编辑器,支持html代码哦', 'type' => 'textarea', 'option' => 'editor', 'value' => '<a href="https://yuzhe.liyiyi.name">我是编辑器默认值</a>', 'config_style' => '', ), 'imagefield' => array( 'title' => '上传图片', 'tips' => '我是图片字段', 'type' => 'image', 'value' => '', 'config_style' => '', ), ); |
插件介绍:雨哲企业建站系统 是基本discuz!系统上的插件功能,完美结合Discuz!功能,给自己的网站增加一个用户自助申请企业网站的功能。
下载地址:http://addon.discuz.com/?@yuzhe_company.plugin
GMT+8, 2024-5-20 10:45 , Processed in 0.380971 second(s), 10 queries , Xcache On.
Powered by Discuz! X3.2
© 2001-2013 Comsenz Inc.