tx_news与pw_comment插件拼写错误3

时间:2016-07-19 10:30:52

标签: typo3 fluid extbase tx-news

我需要使用评论选项构建新闻详情页面。进入详细信息页面时,必须有一个评论选项。所以我配置了pw_comment插件。它工作正常。但所有评论都显示每条新闻。如何只显示相关新闻的评论?请帮帮我

我的typoscript设置是

plugin.tx_pwcomments {
    settings {
        useEntryUid = 1
        entryUid = TEXT
        moderateNewComments = 0
        secondsBetweenTwoComments = 60
        entryUid.data = GP:tx_news|uid
        replaceUsernameWith = COA_INT
        replaceUsernameWith {
            10 = TEXT
            10.data = LLL:EXT:pw_comments/Resources/Private/Language/locallang.xml:tx_pwcomments.newComment.loggedInAs

            20 = TEXT
            20.data = TSFE:fe_user|user|username
            20.noTrimWrap = | <b>|</b>|

            stdWrap.wrap = <div class="loggedInAs">|</div>
        }

        replaceMailWith = TEXT
        replaceMailWith.stdWrap.char = 0
    }
}
config.contentObjectExceptionHandler = 0

我的模板包含以下内容

<f:if condition="{settings.templateLayout} == 'NewsCommentLayout' ">
        <f:then>
                <f:cObject typoscriptObjectPath="lib.pwCommentsIndex" />
                <f:cObject typoscriptObjectPath="lib.pwCommentsNew"/>
        </f:then>

</f:if>

2 个答案:

答案 0 :(得分:2)

我为我的问题找到了解决方案。我编辑了typoscript。

plugin.tx_pwcomments {
    settings {
        moderateNewComments = 0
        secondsBetweenTwoComments = 60
        enableCommentVotes = 0
        enableVoting = 0
        hideVoteButtons = 1
        replaceUsernameWith = COA_INT
        replaceUsernameWith {
            10 = TEXT
            10.data = LLL:EXT:pw_comments/Resources/Private/Language/locallang.xml:tx_pwcomments.newComment.loggedInAs

            20 = TEXT
            20.data = TSFE:fe_user|user|username
            20.noTrimWrap = | <b>|</b>|

            stdWrap.wrap = <div class="loggedInAs">|</div>
        }

        replaceMailWith = TEXT
        replaceMailWith.stdWrap.char = 0
    }
}
config.contentObjectExceptionHandler = 0

[globalVar = GP:tx_news_pi1|news > 0]
plugin.tx_pwcomments.settings {
  useEntryUid = 1
  entryUid = TEXT
  entryUid.data = GP:tx_news_pi1|news
}
[global]

答案 1 :(得分:0)

你需要在某个地方设置条件,以便每个新闻只显示相关评论,而不是所有新闻系统。

最好用TypoScript显示它们,然后为某些不显示的新闻制作条件。