MG 2.2 Force rating & comment/review

PapaTango

Member
Having both a 'generic' comment post box and a comment post box in "Leave a rating' has proven to be very confusing to members--and defeats the purpose of my site's galleries and albums--to rate and review. I would think that there would be a core setting to turn off general commenting, but I have not been able to find such a thing.

In the alternate, I edited the xfmg_comment_macros template to ignore that box as shown:

<xf:comment>
<xf:macro name="comment_add" arg-comments="!" arg-content="!" arg-linkPrefix="!">
<xf:set var="$isPreRegComment" value="{{ $content.canAddCommentPreReg() }}" />
<xf:if is="$content.canAddComment() OR $isPreRegComment">
<xf:form action="{{ link($linkPrefix . '/add-comment', $content) }}"
ajax="true"
draft="{{ link($linkPrefix . '/draft', $content) }}"
class="block js-quickReply"
data-xf-init="quick-reply{{ ($xf.visitor.isShownCaptcha() AND !$isPreRegComment) ? ' guest-captcha' : '' }}"
data-captcha-context="xfmg_guest_comment_quick_reply"
data-message-container="< :prev | .js-replyNewCommentContainer">

<xf:js src="xf/message.js" min="1" />
<xf:js src="xf/captcha.js" min="1" />

<xf:set var="$lastPost" value="{$comments|last}" />

<div class="block-container">
<div class="block-body">
<xf:macro template="quick_reply_macros" name="body"
arg-message="{$content.draft_comment.message}"
arg-messageSelector=".js-comment"
arg-supportsMultiQuote="{$xf.options.multiQuote}"
arg-multiQuoteHref="{{ link($linkPrefix . '/multi-quote', $content) }}"
arg-multiQuoteStorageKey="multiQuoteMediaItem"
arg-simple="{{ true }}"
arg-submitText="{{ phrase('post_comment') }}"
arg-lastDate="{$lastPost.comment_date}"
arg-showGuestControls="{{ !$isPreRegComment }}"
arg-previewUrl="{{ link($linkPrefix . '/preview', $content) }}" />
</div>
</div>
</xf:form>
</xf:if>
</xf:macro>
</xf:comment>

This begins around line 426 and through the end of the template.

Users are now compelled to use the Rate/Review button in order to leave comments. Those comments then appear normally in the position the general comment box formerly lived in.

However, this edit does a predictable thing that happens when cutting out a macro--errors are thrown in the templater.php file.

Any thoughts?
 
Back
Top Bottom