heggsta / silverstripe-elemental-listing
silverstripe-elemental 模块的列表元素
dev-master / 1.x-dev
2020-06-23 00:57 UTC
Requires
Requires (Dev)
- phpunit/phpunit: ^5.7
- squizlabs/php_codesniffer: ^3.0
This package is auto-updated.
Last update: 2024-09-23 10:36:52 UTC
README
该模块提供了一个 Silverstripe Elemental 元素,允许CMS用户配置任意内容的列表。核心实现基于 Marcus Nyeholt 的 ListingPage 模块。
要求
- SilverStripe CMS 4.3+
- Elemental
- MultiValueField
安装
composer require heggsta/silverstripe-elemental-listing
配置选项
概述
Heggsta\ElementalListing\Elements\ElementListing sample_template_pagination: '<%-- .ss template pagination sample code here --%>' cms_templates_disabled: true file_template_sources: - 'themes/mytheme'
描述
sample_template_pagination
在 TextareaField 中显示的字符串,例如分页 - 这仅提供了一些辅助模板代码,以便CMS用户将分页添加到列表模板。如果值为false或空字符串,则此字段不会显示。
默认
<% if $Items.MoreThanOnePage %>
<ul>
<% if $Items.NotFirstPage %>
<li><a class="prev" href="\$Items.PrevLink">Previous</a></li>
<% end_if %>
<% loop $Items.PaginationSummary %>
<li>
<% if $CurrentBool %>
<span>$PageNum</span>
<% else %>
<% if $Link %><a href="$Link">$PageNum</a><% else %><span>...</span><% end_if %>
<% end_if %>
</li>
<% end_loop %>
<% if $Items.NotLastPage %>
<li><a class="next" href="$Items.NextLink">Next</a></li>
<% end_if %>
</ul>
<% end_if %>
cms_templates_disabled
设置为true以在CMS中禁用编辑列表模板的字段。
默认: false
file_template_sources
要扫描列表模板的相对于项目根目录的位置数组。如果存在任何模板,CMS用户可以选择一个用于渲染列表。
在源目录中,模板必须放置在 templates/Heggsta/ElementalListing/ListingTemplates/
目录中,例如 templates/Heggsta/ElementalListing/ListingTemplates/MyTemplate.ss
默认: []
(空数组)
额外致谢
Marcus Nyeholt (https://github.com/nyeholt/)