Hide "No comments" #340
-
|
Hi, Is it possible for Akeeba Engage to hide the message at the bottom of the form: "No comments - Nobody has submitted a comment yet."? And in Spanish after the End of the article: "No hay comentarios" (There are no comments)? It would be great for me! Many thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
End of articleYou can do a template override of Hint: you can do template overrides from System, Site Templates. Click on your template, then go to the Create Overrides tab. Click on com_engage, comments. This creates your override files in In that file there's this piece of code which prints the number of comments: <h3 class="akengage-title h4 border-bottom mb-2">
<?= Text::plural($this->headerKey, $this->pagination->total, $this->title) ?>
</h3>Change it to this in your override: <?php if ($this->pagination->total > 0): ?>
<h3 class="akengage-title h4 border-bottom mb-2">
<?= Text::plural($this->headerKey, $this->pagination->total, $this->title) ?>
</h3>
<?php endif; ?>The if-block you put around it will only print something if there's at least one comment, i.e. it will no longer print the ‘No comments on “Your Article Title Here”’ header. Bottom of the formMake a template override for modules/mod_engage_latest/tmpl/default.php. Find this code: elseif (empty($comments)): ?>
<div class="alert alert-info">
<h4 class="alert-heading">
<?= Text::_('MOD_ENGAGE_LATEST_ERR_NOCOMMENTS_HEAD') ?>
</h4>
<p>
<?= Text::_('MOD_ENGAGE_LATEST_ERR_NOCOMMENTS_BODY') ?>
</p>
</div>
<?php
return;
endif;and change it to <?php
return;
endif; |
Beta Was this translation helpful? Give feedback.
-
|
Hi, Thank you for helping. The first "override" was okay, it eliminated the "No comments" (Spanish: No hay comentarios) But the second override didn't work. I got the following error message: When doing the second override, it didn't appear the "tmpl" after "mod_engage_latest". And I didn't delete any files there. I only made the changes you suggested. Have I missed anything? NOTE: Why the comments disappear from the front page? They appear only on the Administrator site, Components, Akeeba Engage. Is that normal, I mean, is it on purpose? |
Beta Was this translation helpful? Give feedback.
-
|
Sorry! It didn't work! I only deleted the '<?php' from the file. Error message: |
Beta Was this translation helpful? Give feedback.


End of article
You can do a template override of
components/com_engage/tmpl/comments/default.php.Hint: you can do template overrides from System, Site Templates. Click on your template, then go to the Create Overrides tab. Click on com_engage, comments. This creates your override files in
templates/YOUR_TEMPLATE_HERE/html/com_engage/comments. Delete all files exceptdefault.phpin there.In that file there's this piece of code which prints the number of comments:
Change it to this in your override: