wpgcms的详情页面的数据会被保存在 contentInfo 这么一个字段里面。
面包屑导航调用:
当前位置 {
% for c in crumb|slice(1, crumb|length-1) %} { % if not loop.last %}> { { c.name }} { % else %}> 新闻详情 { % endif %}{ % endfor %}
标题,正文,时间的调用:
{ { contentInfo.title }}
{% autoescape false %} { { contentInfo.getBodyInfo() }} {% endautoescape %}{% set pubtime = contentInfo.publish_time %} 时间:{ { pubtime|slice(0, 4) }}年{ { pubtime|slice(5, 2) }}月{ { pubtime|slice(8, 2) }}日 来源:{ { contentInfo.source_name|default('金塔集团') }} 阅读:{ { contentInfo.view_count }}
下一篇,下一篇的调用:
{ nextInfo.title }} {% endif %}
完整实例:
{% extends 'layout.html' %}{% block pageContent %}{% endblock %} 当前位置 {% for c in crumb|slice(1, crumb|length-1) %} {% if not loop.last %}> { { c.name }} {% else %}> 新闻详情 {% endif %} {% endfor %}
{ { contentInfo.title }}
{% autoescape false %} { { contentInfo.getBodyInfo() }} {% endautoescape %}{% set pubtime = contentInfo.publish_time %} 时间:{ { pubtime|slice(0, 4) }}年{ { pubtime|slice(5, 2) }}月{ { pubtime|slice(8, 2) }}日 来源:{ { contentInfo.source_name|default('金塔集团') }} 阅读:{ { contentInfo.view_count }}{ nextInfo.title }} {% endif %}