重温记忆 發表於 2024-1-19 00:00:00

DedeCMS新建模型字段中【附件样式】的修改方法

<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        本文实例讲述了DedeCMS新建模型字段【附件样式】修改方法。分享给大家供大家参考。具体实现方法如下:</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        当我们在系统模型中添加了一个自定义附件类型字段的时候,例如我在后台添加一个名为"fujian"的附件类型的字段,字段的实际内容为:'/uploads/soft/2245/1-255477.jpg' 倘若前台调用直接用{dede:field.fujian/}则显示下面的内容:<br>
         </p>
<div class="msgheader" style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
        <div class="right">
                <span><u>复制代码</u></span>
</div>
        代码如下:</div>
<div class="msgborder" id="phpcode7" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
        &lt;table width='300'&gt; <br>
        &lt;tr&gt; <br>
        &lt;td height='30' width='20'&gt;&lt;a href='/uploads/soft/130531/1-130531151935.doc' target='_blank'&gt;&lt;img src='~cfg_phpurl~/img/addon.gif' border='0' align='center'&gt;&lt;/a&gt;&lt;/td&gt; <br>
        &lt;td&gt;&lt;a href='/uploads/soft/130531/1-130531151935.doc' target='_blank'&gt;&lt;u&gt;/uploads/soft/2245/1-255477.jpg&lt;/u&gt;&lt;/a&gt;&lt;/td&gt; <br>
        &lt;/tr&gt; <br>
        &lt;/table&gt;</div>
<br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>我只想调用/uploads/soft/130531/1-130531151935.doc该怎么办呢?</span>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
         </p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        这个样式用的模板是在/templets/system/channel_addon.htm的文件,只需要把里面的内容改为~link~即可.</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        希望本文所述对大家的dedecms建站有所帮助。</p>
頁: [1]
查看完整版本: DedeCMS新建模型字段中【附件样式】的修改方法