php ページリストブロックの最新版
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php ページリストブロックの最新版相关的知识,希望对你有一定的参考价值。
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$c = Page::getCurrentPage();
/** @var \Concrete\Core\Utility\Service\Text $th */
$th = Core::make('helper/text');
/** @var \Concrete\Core\Localization\Service\Date $dh */
$dh = Core::make('helper/date');
if ($c->isEditMode() && $controller->isBlockEmpty()) {
?>
<div class="ccm-edit-mode-disabled-item"><?php echo t('Empty Page List Block.') ?></div>
<?php
} else {
?>
<!-- <div class="ccm-block-page-list-wrapper"> -->
<div class="">
<?php
$includeEntryText = false;
if (
(isset($includeName) && $includeName)
||
(isset($includeDescription) && $includeDescription)
||
(isset($useButtonForLink) && $useButtonForLink)
) {
$includeEntryText = true;
}
foreach ($pages as $page) {
// Prepare data for each page being listed...
$buttonClasses = 'ccm-block-page-list-read-more';
$entryClasses = 'ccm-block-page-list-page-entry';
$title = $page->getCollectionName();
if ($page->getCollectionPointerExternalLink() != '') {
$url = $page->getCollectionPointerExternalLink();
if ($page->openCollectionPointerExternalLinkInNewWindow()) {
$target = '_blank';
}
} else {
$url = $page->getCollectionLink();
$target = $page->getAttribute('nav_target');
}
$target = empty($target) ? '_self' : $target;
$description = $page->getCollectionDescription();
$description = $controller->truncateSummaries ? $th->wordSafeShortText($description, $controller->truncateChars) : $description;
$thumbnail = false;
if ($displayThumbnail) {
$thumbnail = $page->getAttribute('thumbnail');
}
if (is_object($thumbnail) && $includeEntryText) {
$entryClasses = 'ccm-block-page-list-page-entry-horizontal';
}
$date = $dh->formatDateTime($page->getCollectionDatePublic(), true);
/* CUSTOM ATTRIBUTE EXAMPLES:
* $example_value = $page->getAttribute('example_attribute_handle', 'display');
*
* When you need the raw attribute value or object:
* $example_value = $page->getAttribute('example_attribute_handle');
*/
/* End data preparation. */
/* The HTML from here through "endforeach" is repeated for every item in the list... */ ?>
<div class="<?php echo $entryClasses ?>">
<?php if ($includeEntryText) {
?>
<div class="">
<?php if (isset($includeName) && $includeName) {
?>
<div class="">
<a data-lity href="<?php echo h($url) ?>"
target="<?php echo h($target) ?>"><?php echo h($title) ?></a>
</div>
<?php
} ?>
</div>
<?php
} ?>
</div>
<?php
} ?>
</div><!-- end .ccm-block-page-list-pages -->
<?php if (count($pages) == 0) { ?>
<div class="ccm-block-page-list-no-pages"><?php echo h($noResultsMessage) ?></div>
<?php } ?>
<?php if ($showPagination) { ?>
<?php echo $pagination; ?>
<?php } ?>
<?php
} ?>
以上是关于php ページリストブロックの最新版的主要内容,如果未能解决你的问题,请参考以下文章
html Flexbox的を使ったブロック型ナビゲーションメニュー
css 画像スライダー//四角の中に縦に5つのブロックを表示させる//来源https://jsbin.com/ziqiceh