Keyword

Removing requirement for email +URL from Comments

  • William Sands
  • William Sands's Avatar Topic Author
  • Offline
  • New Member
More
12 years 4 months ago #66780 by William Sands
Hi,
I'm trying to remove the requirement for commenters to input their email and URL when commenting on items in K2. I found a link elsewhere that suggested I remove 2 sections ( <label class="formEmail" and <label class="formUrl" ) from item_comments_form.php (winfoes.co.uk/joomla-faq/components/3-joomla-components/32-how-do-i-remove-url-field-from-k2-comments -oddly offline as I post this)

This removes the email and url fields from the comment form but comments then can't be posted as it needs text in all fields. Yes, there is text in both visible fields when I try to submit.

I'm hoping someone can help, unfortunately it is on an intranet site so you won't be able to view the live site.

I have attached the untouced item_comments_form.php as txt.

Thanks v much,
William
Attachments:

Please Log in or Create an account to join the conversation.

More
12 years 4 months ago #66781 by Kit
The easiest thing to do, which will let you add a lot more options, is to install the fox contact plugin. It's compatible with k2.
extensions.joomla.org/extensions/contacts-and-feedback/contact-forms/16171

Please Log in or Create an account to join the conversation.

  • William Sands
  • William Sands's Avatar Topic Author
  • Offline
  • New Member
More
12 years 4 months ago #66782 by William Sands
Replied by William Sands on topic Re: Removing requirement for email +URL from Comments
Thanks Kit, it looks powerful and I will look into it further but I am hoping to stay with K2 comments as I need easy access to the data relating to comments, and K2 does that nicely. I just would like to get rid of the email and url fields...

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago - 12 years 3 months ago #66783 by Kit
Holy cow, I just realized I didn't answer your question at all, and answered something else. :blush: I'm SO sorry! As for your question:

You have a couple of options here:

1. Open the file
components -> com_k2 -> models -> item.php

around line number 910 you should see:
Log in  or Create an account to join the conversation.

  • William Sands
  • William Sands's Avatar Topic Author
  • Offline
  • New Member
More
12 years 3 months ago #66784 by William Sands
Replied by William Sands on topic Re: Removing requirement for email +URL from Comments
Thanks Kit, that looks like it will work. It's Friday 5pm here so I won't try it till next week - I will let you know how it goes.

Excellent help, thankyou!

Please Log in or Create an account to join the conversation.

  • William Sands
  • William Sands's Avatar Topic Author
  • Offline
  • New Member
More
12 years 3 months ago #66785 by William Sands
Replied by William Sands on topic Re: Removing requirement for email +URL from Comments
It worked!
I then removed the field from displaying in the Item comments form.php and we now have a much simpler comment form for the troubleshooting page on our intranet.

Thanks very much Kit, wonderful work.
William

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #66786 by william white
Replied by william white on topic Re: Removing requirement for email +URL from Comments
Nice, now would anyone like to explore doing this trick with an override as described here? Results would be most interesting and install would survive upgrade even if override needed tweaking afterwards
community.joomla.org/blogs/community/521-did-you-know-overrides-are-not-just-for-html.html

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #66787 by Uldis
Thank you for providing this fix !

I too would be very happy if someone was smart enought to do this with what William White suggested :)

Please Log in or Create an account to join the conversation.