J5增加PDF附件下载功能

weeya1年前JTBC教程517

1、模块管理增加att字段,选择29附件管理器
2、模板代码
<table class="table table-striped m-0">
<tbody>
<tr>
<th class="border-top-0">
 附件下载:
</th>
<td class="border-top-0">
<a href="{$=$htmlEncode($getValueFromJSON(#att, '0->filepath'))}" alt="{$=$htmlEncode($getValueFromJSON(#att, '0->filename'))}" target="_blank">{$=$htmlEncode($getValueFromJSON(#att, '0->filename'))}
</a>
</td>
<td class="border-top-0">
<a href="{$=$htmlEncode($getValueFromJSON(#att, '1->filepath'))}" alt="{$=$htmlEncode($getValueFromJSON(#att, '1->filename'))}" target="_blank">{$=$htmlEncode($getValueFromJSON(#att, '1->filename'))}
</a>
</td>
</tbody>
</table>
到此完工。


下列方法无上传附件文章id有报错。
2、模板调用{$=$render('global.render.pdf',$jsonDecode(#att))}
3、pdf节点代码如下:
<table class="table table-striped m-0">
<tbody>
{@}<tr>
<th class="border-top-0">
附件下载:
</th>
<td class="border-top-0">
<a href="{$filepath}" alt="{$filename}" target="_blank">{$filename}
</a>
</td>
</tr>
{@}
</tbody>
</table>

相关文章

J5_09搜索

    需要在可以被搜索的模块目录中手动添加common/search.jtbc引导文件来激活搜索功能    需要手动构建关键字输入框并通过...

J5_07核心团队合作伙伴

核心团队team/荣誉资质honor,有列表页,有内容页{@}<a href="./?type=detail&amp;id={$id}" class="id...

J5_04产品新闻列表页

1、头尾模板调用代码{$=$take('global.communal.header')}{$=$take('global.communal.footer')}1、模块...

J5_01安装相关

JTBC5.0笔记jtbc模板里只要理解3个东西就完事儿了1个叫 $take1个叫 $render另外1个叫 $fetch/Config/DB/MySQL.php,数据库链接~~~~~~~~~~~~~...

J5增加tag标签自定义URL

1、index.php文件detail节点$rsTag = strval($rs -> tag);//增加tag模块管理-添加字段tag,16标签输入框。2、tag/矿山副井井筒装备安装/htt...

J5_03首页模板

1、头尾模板调用代码{$=$take('global.communal.header')}{$=$take('global.communal.footer')}2、调用...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。