ありがとうございます。
http://www.webli.us/cheatsheet/doku.phpを拝見しましたが、具体的にどのPHPファイルを編集すればいいのでしょうか?
あと、オートナビのパンくずの表示はCSSを編集することにより表示されるようになりました。
よろしくお願い致します。
カスタムテンプレートについて
2015年6月10日 at 15:01
5.6で使用していたページリスト用のカスタムテンプレートを5.7で使用することは可能でしょうか?
可能でしたら、そのやり方を教えてください。
また、オートナビのカスタムテンプレートをパンくずに設定した場合、5.6では横並びになりましたが、5.7では縦に並び且つページ名の隣に連番が表示されてしました。
5.6のように連番を非表示にして横並びにすることはできますでしょうか?
ご教示ください。
タグ:
Re: カスタムテンプレートについて
2015年6月15日 at 14:51
失礼しました。
blocksになっております。
PHPの記述は以下になります。問題箇所をご指摘いただけませんでしょうか?
-----------------------------------------------------------------------------------------------------------------------
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$textHelper = Loader::helper("text");
// now that we're in the specialized content file for this block type,
// we'll include this block type's class, and pass the block to it, and get
// the content
if (count($cArray) > 0) { ?>
<ul class="ccm-page-list">
<?php
for ($i = 0; $i < count($cArray); $i++ ) {
$cobj = $cArray[$i];
$target = $cobj->getAttribute('nav_target');
if ($cobj->getCollectionPointerExternalLink() != '') {
if ($cobj->openCollectionPointerExternalLinkInNewWindow()) {
$target = "_blank";
}
}
$title = $textHelper->entities($cobj->getCollectionName()); ?>
<li>
<h3><a <?php if ($target != '') { ?> target="<?php echo $target?>" <?php } ?> href="<?php echo $nh->getLinkToCollection($cobj)?>"><?php echo $title?></a></h3>
<h4><?php echo $cobj->getCollectionDatePublic('Y-m-d') ?></h4>
<p><?php if ( "" != $cobj->getCollectionDescription() ) { ?></p>
<div class="ccm-page-list-description">
<?php
if(!$controller->truncateSummaries){
echo $textHelper->entities($cobj->getCollectionDescription());
}else{
echo $textHelper->entities($textHelper->shorten($cobj->getCollectionDescription(),$controller->truncateChars));
}
?>
</div>
<?php } ?>
<div class="meta">
<?php echo $comments; ?> <a <?php if ($target != '') { ?> target="<?php echo $target?>" <?php } ?> href="<?php echo $nh->getLinkToCollection($cobj)?>"><?php echo t('詳細を見る'); ?> »</a>
</div>
<hr class="blog-entry-divider"/>
</li>
<?php } ?>
</ul>
<?php
if(!$previewMode && $controller->rss) {
$btID = $b->getBlockTypeID();
$bt = BlockType::getByID($btID);
$uh = Loader::helper('concrete/urls');
$rssUrl = $controller->getRssUrl($b);
?>
<div class="ccm-page-list-rss-icon">
<a href="<?php echo $rssUrl?>" target="_blank"><img src="<?php echo $uh->getBlockTypeAssetsURL($bt, 'rss.png')?>" width="14" height="14" alt="<?php echo t('RSS Icon')?>" title="<?php echo t('RSS Feed')?>" /></a>
</div>
<link href="<?php echo BASE_URL . $rssUrl?>" rel="alternate" type="application/rss+xml" title="<?php echo $textHelper->entities($controller->rssTitle)?>" />
<?php
}
}
if ($paginate && $num > 0 && is_object($pl)) {
$pl->displayPaging();
}
?>
blocksになっております。
PHPの記述は以下になります。問題箇所をご指摘いただけませんでしょうか?
-----------------------------------------------------------------------------------------------------------------------
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$textHelper = Loader::helper("text");
// now that we're in the specialized content file for this block type,
// we'll include this block type's class, and pass the block to it, and get
// the content
if (count($cArray) > 0) { ?>
<ul class="ccm-page-list">
<?php
for ($i = 0; $i < count($cArray); $i++ ) {
$cobj = $cArray[$i];
$target = $cobj->getAttribute('nav_target');
if ($cobj->getCollectionPointerExternalLink() != '') {
if ($cobj->openCollectionPointerExternalLinkInNewWindow()) {
$target = "_blank";
}
}
$title = $textHelper->entities($cobj->getCollectionName()); ?>
<li>
<h3><a <?php if ($target != '') { ?> target="<?php echo $target?>" <?php } ?> href="<?php echo $nh->getLinkToCollection($cobj)?>"><?php echo $title?></a></h3>
<h4><?php echo $cobj->getCollectionDatePublic('Y-m-d') ?></h4>
<p><?php if ( "" != $cobj->getCollectionDescription() ) { ?></p>
<div class="ccm-page-list-description">
<?php
if(!$controller->truncateSummaries){
echo $textHelper->entities($cobj->getCollectionDescription());
}else{
echo $textHelper->entities($textHelper->shorten($cobj->getCollectionDescription(),$controller->truncateChars));
}
?>
</div>
<?php } ?>
<div class="meta">
<?php echo $comments; ?> <a <?php if ($target != '') { ?> target="<?php echo $target?>" <?php } ?> href="<?php echo $nh->getLinkToCollection($cobj)?>"><?php echo t('詳細を見る'); ?> »</a>
</div>
<hr class="blog-entry-divider"/>
</li>
<?php } ?>
</ul>
<?php
if(!$previewMode && $controller->rss) {
$btID = $b->getBlockTypeID();
$bt = BlockType::getByID($btID);
$uh = Loader::helper('concrete/urls');
$rssUrl = $controller->getRssUrl($b);
?>
<div class="ccm-page-list-rss-icon">
<a href="<?php echo $rssUrl?>" target="_blank"><img src="<?php echo $uh->getBlockTypeAssetsURL($bt, 'rss.png')?>" width="14" height="14" alt="<?php echo t('RSS Icon')?>" title="<?php echo t('RSS Feed')?>" /></a>
</div>
<link href="<?php echo BASE_URL . $rssUrl?>" rel="alternate" type="application/rss+xml" title="<?php echo $textHelper->entities($controller->rssTitle)?>" />
<?php
}
}
if ($paginate && $num > 0 && is_object($pl)) {
$pl->displayPaging();
}
?>
Your post has been saved and will be published after approval by the forum moderator.
しかたこうき
Re: カスタムテンプレートについて
可能です。基本的には、5.6までのカスタムテンプレートと同じ仕組みになっています。
一部コードが5.7で書き方が変わっています。下記URLにアクセスし、
「Working With Page Lists」の段落を確認してください。
http://www.webli.us/cheatsheet/doku.php
それ以外は、基本的に5.6の時と同じやり方で実現できます。
おそらく、テーマやカスタムテンプレートの段階で、マークアップかCSSが正しく適用されていないのだと思います。
試しに、ローカルに5.7を入れてサンプルコンテンツ+Elementalでオートナビ+パンくずリストのカスタムテンプレートを試しましたら、正しく横並びとなっています。
もう一度、ご自身のサイトで、CSSが正しく設計・適用されているか確認してみてください。