Skip to content

Commit

Permalink
Merge pull request #96 from s-nakajima/master
Browse files Browse the repository at this point in the history
ページ内リンク処理を追加
  • Loading branch information
s-nakajima committed Aug 13, 2016
2 parents e6ea276 + fa8035e commit 481e07f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion View/BbsArticles/view.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ echo $this->NetCommonsHtml->css(array(
echo $this->NetCommonsHtml->script('/likes/js/likes.js');
?>

<article class="bbs-article">
<article class="bbs-article" ng-init="hashChange()">
<?php
//根記事
echo $this->element('BbsArticles/view_bbs_article', array(
Expand Down
14 changes: 3 additions & 11 deletions View/Elements/BbsArticles/view_bbs_article.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ $linkFormatId = BbsArticlesController::LINK_ID_FORMAT;
?>

<?php if ($isRootArticle) : ?>
<h1 id="/<?php echo sprintf($linkFormatId, $bbsArticle['BbsArticleTree']['id']); ?>">
<h1 id="<?php echo sprintf($linkFormatId, $bbsArticle['BbsArticleTree']['id']); ?>">
<?php else : ?>
<h2 id="/<?php echo sprintf($linkFormatId, $bbsArticle['BbsArticleTree']['id']); ?>">
<h2 id="<?php echo sprintf($linkFormatId, $bbsArticle['BbsArticleTree']['id']); ?>">
<?php endif; ?>

<?php
Expand Down Expand Up @@ -65,15 +65,7 @@ $linkFormatId = BbsArticlesController::LINK_ID_FORMAT;
<div class="bbs-article-body">
<?php if (isset($parentBbsArticle)) : ?>
<div class="bbs-parent-article">
<?php
if ($parentBbsArticle['BbsArticleTree']['article_no'] !== '1') :
$parentLinkId = sprintf($linkFormatId, $parentBbsArticle['BbsArticleTree']['id']);
else :
$parentLinkId = '';
endif;
?>

<a href="#<?php echo $parentLinkId; ?>">
<a href="#<?php echo sprintf($linkFormatId, $parentBbsArticle['BbsArticleTree']['id']); ?>">
<?php echo sprintf(__d('bbses', '&gt;&gt; %s'), $parentBbsArticle['BbsArticleTree']['article_no']); ?>
</a>
</div>
Expand Down

0 comments on commit 481e07f

Please sign in to comment.