Add custom text at the beginning of the commenting section

RSComments! does not include a default feature that would allow displaying a custom message at the beginning of the commenting section. However, with a little bit of custom scripting and using template overrides, this can be achieved.

 

Template overrides

Joomla! provides a feature that allows modifying a component's / module's view file(s) without losing the modifications when a possible future update is performed. Each Joomla! template includes a folder named html in which these view files can be copied and modified. The copied files will, then, be loaded from here instead of their original location, inside the component's folder. Joomla! will recognize which component they are written for by the folder structure found in html.

Let's assume that you are using the default Protostar template for Joomla! 3.x. Here's what you need to do to implement this scenario:

  • In /templates/protostar/html/ create the following folder structure:

    /com_rscomments/rscomments

  • Head to /components/com_rscomments/views/rscomments/tmpl/, copy the form.php file and paste it in the folder you created earlier
Performing template overrides for RSComments!
 

Adding the custom text

Edit the form.php file that you have copied and look for the following line:

<div class="rscomment-form well<?php if ($this->config->comment_form_position) { ?> rscomment-form-top<?php } ?>">

Right after this line, add your custom text inside a paragraph, as in the following example:

<h4>Tell us what you think about this article</h4>

 

One person found this article helpful.


Was this article helpful?

Yes No
Sorry about that

You Should Also Read

How can i enable comments on a page ? HOT

How do I hide the commenting form by default when using the accordion effect

Migrate RSComments! from Joomla! 2.5 to 3.x