Using the comment URL field for other purposes
Comments allows you to optionally collect a web site URL from the comment poster. At present (and this may change in a future version), this field can be used for non-URL purposes to collect different information. For example, you may like the poster to enter the their country or locality. To do this, we can use the Joomla layout override system to change the URL link into plain text, and the language files to change the label.
The directory default_template refers to the template that is set as the default for your site. Please replace this name with the actual name of the template directory.
To create the layout override for the comment form, find the file:
/modules/mod_comments_comment/tmpl/default_comment.php
Copy this to:
/templates/default_template/html/mod_comments_comment/default_comment.php
In the new file, find the line that looks similar to the following:
<a href="/<?php echo $item->url;?>" target="_blank" rel="nofollow"><?php echo (!empty($item->$_name)) ? $item->$_name : $item->name; ?></a>
Change this line to the following:
<?php echo (!empty($item->$_name)) ? $item->$_name : $item->name; ?> from <?php echo htmlspecialchars($item->url); ?>
To change the form label, we need to modify the lanugage files. Please note
Find the following file:
/language/en-GB/en-GB.mod_comments_comment.ini
Find the following line:
COMMENTS_WEBSITE=Personal Web site/Blog URL
Change the part after the equals sign to the desired text as shown:
COMMENTS_WEBSITE=Where are you from?
Please note that the language files will be overwritten when you upgrade the Comments extensions. You will need to make the changes again after you upgrade.
No problem, support subscriptions give you access to one-on-one help from real Joomla experts.