2

Joomla 3.9.14

Is it possible to edit a list of contacts from the front end?

I need to display a list of contacts from a certain category, and allow administrators to edit their details.

Currently administrators have to login to the back end to do this. I'm trying to keep back end access to a minimum.

I assumed this would have been a default option / menu item within Joomla?

0

As far as I can tell, front-end editing of contacts has never been an included feature in Joomla.

There are some third party extensions that can enable this feature:

Trombinoscope Contacts Pro

Contact Enhanced Component

  • Thanks for those links! I think this is a possible addition to Joomla 4 – jonboy Jan 14 at 12:44
  • Hrmm. Maybe my memory is worse on this than I thought. I could have sworn I had this set up in one of my earlier Joomla sites. But, if that memory is the only reason I have to doubt you on this, it's not good enough, and I'll accept that you're right about it never being there. – Arlen Jan 14 at 14:22
  • @jonboy Hope you're right. A quick check of 4alpha12 fails to find a save action in the controller and no model to process the form on the front-end, but that was a quick superficial check. Hope I'm wrong. – Arlen Jan 14 at 14:33
-1

Um, the very definition of an administrator's role is back-end access. In any case, what you do will end up being governed by the site's permissions.

(Everything below has been edited. This shows the folly of answering from memory, as the original answer has been invalidated by changes made since the last time I'd done any extensive relying on com_contact (I basically surrendered to the spammers and took that out of almost all of my sites and drastically curtailed what it did on the rest). My apologies for misleading, and my thanks for calling me on it. while I was checking to see if permissions were still available for some groups, I should have double-checked the site output that it was still the case. It's not.)

Logged-in users should be given buttons on the front-end, but that's been removed. I understand why (it gives people not normally given access to the back end the ability to change the destination of emails sent by the system to a contact, not something that should be done as a general rule).

This means the simplest answer is adding in a different component for contact handling, one that allows for front-end editing.

If you really want to do this with com_contact, however, the way to add the button is simple, but getting more functionality out of it will require forking com_content, I'm afraid. The button code can be added in your template override by testing for permission to edit, and if it's permitted, add the button.

The fork of com_contact will need to make the model and form from the admin side usable on the site side, either directly or by copy/paste into site models, because the default "edit" form on the front-end is for sending email to the contact, not modifying the contact. You'll need to add a model analogous to the one found in 'form.php' in com_content, or simply recreate the contact form model from the admin side.

Yes, I glossed over the details for coding that, simply because covering all the details of that is a book chapter, not a StackExchange answer. It's possible to simply duplicate the admin side pieces by adding the contact admin model as use and then extending it with the PHP class, which sounds simpler but still has some bumps to smooth out.

Honestly, my best recommendations are to keep doing it via back-end or use an add-on for it; forking com_contact and all the individual maintenance that implies (especially with J!4 coming) is probably more effort than its worth.

  • OK, pardon me if these questions are very basic. It's hard to evaluate a person's level of knowledge from a brief question and I need to see precisely where I need to add a better explanation: 1) Do you know logging in to the back-end doesn't log you into the front-end, that they are separate logins? 2) Are you using a custom template for your front-end? 3) If so, does it have a template override in place for the front-end display of a single contact? (it would be in the com_contact folder in the html folder of the template). – Arlen Jan 13 at 16:41
  • Oops. Major edit coming along – Arlen Jan 13 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.