Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ページ内リンク処理を追加 #96

Merged
merged 1 commit into from
Aug 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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