【发布时间】:2019-09-06 14:10:28
【问题描述】:
我正在使用 OctoberCMS DynamicPDF 插件,根据我的要求,它工作得非常好。
Howerver,我有动态 PDF 标题文本内容,我正在尝试覆盖我的标题内容,但它不起作用。这是我到目前为止所尝试的。
模板文件
{% set headerTExt = 'asdf' %}
布局文件
<html>
<head>
<style type="text/css" media="screen">
{{ css|raw }}
</style>
<title>Regency Brochure</title>
</head>
<div id="header">
<div style="display: inline-block; position: absolute; left: 2.5%; top: 12px;">
<img src="{{ logo }}" style="width: 60px; height:auto; margin-top:5px;"/>
</div>
<div style="text-align: right; font-size: 20px; color: #b49132; text-transform: uppercase; font-family: 'Montserrat-Bold'; position: absolute; right: 3.5%; top: 25px;">
{{ headerTExt }}
</div>
</div>
<div id="footer">
<div class="footerText">www.regencycorporate.com.au</div>
</div>
{{ content_html|raw }}
</html>
布局文件 CSS
@page { margin:25mm 0px 8mm 0px;}
header { position: fixed; left: 0px; top:-25mm; right: 0px; height: 22mm; background-color: #fff; border-bottom: solid 1px #d8d8d8;}
footer { position: fixed; left: 0px; bottom:-8mm; right: 0px; background-color: #b49132; height: 11mm; }
footer .footerText { font-size: 14px; text-align: center; color: white; font-family: 'Montserrat-Medium'; font-weight:400; padding-top:8px; }
content{
height:645px;
padding:0px 30px;
}
如您所见,我正在尝试使用{{ headerTExt }} 将动态标题文本设置在我的模板文件中,变量{% set headerTExt = 'asdf' %} 但它不起作用。如果我放置静态文本,它的工作但动态不起作用。
谁能指导我如何让它工作
【问题讨论】:
标签: php octobercms octobercms-plugins octobercms-widgets