Link the article's comment count to the discussion
authorAlexander Ebert <ebert@woltlab.com>
Tue, 9 Jul 2019 13:57:34 +0000 (15:57 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 9 Jul 2019 13:57:34 +0000 (15:57 +0200)
com.woltlab.wcf/templates/article.tpl
wcfsetup/install/files/lib/system/article/discussion/CommentArticleDiscussionProvider.class.php
wcfsetup/install/files/lib/system/article/discussion/IArticleDiscussionProvider.class.php
wcfsetup/install/files/lib/system/article/discussion/VoidArticleDiscussionProvider.class.php

index c4cca3639e71c0369f67e3f3a5bab6fb7a1379c2..31e8509263f652c839fabcc4f2124921d37f8d18 100644 (file)
                                
                                {if $article->getDiscussionProvider()->getDiscussionCountPhrase()}
                                        <li itemprop="interactionStatistic" itemscope itemtype="http://schema.org/InteractionCounter">
-                                               <span class="icon icon16 fa-comments"></span>
-                                               <span>{$article->getDiscussionProvider()->getDiscussionCountPhrase()}</span>
+                                                <span class="icon icon16 fa-comments"></span>
+                                                {if $article->getDiscussionProvider()->getDiscussionLink()}<a href="{$article->getDiscussionProvider()->getDiscussionLink()}">{else}<span>{/if}
+                                                       {$article->getDiscussionProvider()->getDiscussionCountPhrase()}
+                                                {if $article->getDiscussionProvider()->getDiscussionLink()}</a>{else}</span>{/if}
                                                <meta itemprop="interactionType" content="http://schema.org/CommentAction">
                                                <meta itemprop="userInteractionCount" content="{@$article->getDiscussionProvider()->getDiscussionCount()}">
                                        </li>
index 79a49d84399fd56c6d7ae9ce772ccf59e7a466b6..163bdb05b1e2eb49ddbdef570905e5dfe95e2762 100644 (file)
@@ -28,6 +28,13 @@ class CommentArticleDiscussionProvider extends AbstractArticleDiscussionProvider
                return WCF::getLanguage()->getDynamicVariable('wcf.article.articleComments', ['article' => $this->article]);
        }
        
+       /**
+        * @inheritDoc
+        */
+       public function getDiscussionLink() {
+               return '';
+       }
+       
        /**
         * @inheritDoc
         */
index 2f93f943372e7c5d6fe09ef8b8785e60af45464d..e53248de062e4ed1ddc273964ad809c0decde2c7 100644 (file)
@@ -28,6 +28,13 @@ interface IArticleDiscussionProvider {
         */
        public function getDiscussionCountPhrase();
        
+       /**
+        * Returns the permalink to the discussions or an empty string if there is none.
+        * 
+        * @return      string
+        */
+       public function getDiscussionLink();
+       
        /**
         * Renders the input and display section of the associated discussion.
         * 
index d8c1e329d97b420223167722a1cf052e4734a5fb..7c33eb37e86727b4ffebc0ae41d14d161ee3872e 100644 (file)
@@ -27,6 +27,13 @@ class VoidArticleDiscussionProvider extends AbstractArticleDiscussionProvider {
                return '';
        }
        
+       /**
+        * @inheritDoc
+        */
+       public function getDiscussionLink() {
+               return '';
+       }
+       
        /**
         * @inheritDoc
         */