Issue: You wish to allow the user the editing from the articles in the backed (admin view), but not on the frondend (user view).

Solution: Some websites or forum posts mentioned either a CSS code which can hide this option or the ACL. However if the CSS code is used the option is only hidden, if you prefer a secure methode this might be not a solution for you. The ACL option will also not work for you, as you wish to allow the user the edit from the content via the backend. So the only way is a template overwrite.

The solution here is quite simple and can be done in some minutes.

1a.) If you already have a <joomla-root>/templates/<your template name>/html/com_content/article/default.php in your template folder, then download that file locally via FTP (e.g. via FileZilla or similar options) and open it in an editor (e.g. Notepad ++)

1b.) If you do not have a <joomla-root>/templates/<your template name>/html/com_content/article/default.php in your template folder download the <joomla-root>/components/com_content/views/article/tmpl/default.php file locally via FTP (e.g. via FileZilla or similar options) and open it in an editor (e.g. Notepad ++)

2.) Now search for the following line:

$canEdit = $params->get('access-edit');

and change that to:

//$canEdit = $params->get('access-edit');
$canEdit = false;

save the file and close the editor.

3a.) If you have a <joomla-root>/templates/<your template name>/html/com_content/article/default.php in your template folder, then rename that file to default.bak and upload the edited file to the same place (<joomla-root>/templates/<your template name>/html/com_content/article/default.php)

3c.) If you do not have a <joomla-root>/templates/<your template name>/html/com_content/article/default.php in your template folder, then upload the edited file to the same place (<joomla-root>/templates/<your template name>/html/com_content/article/default.php)

4.) Check the result now. If you followed the steps above, the edit button should be gone now for the articles.

Comments (7)

  1. Derrick

What if that line can't be found? I searched manually as well for that line in the correct directory and cannot find that exact line

  Attachments
 
  1. Bastian W.    Derrick

It might be template specified. If you use a template from one from the Template Clubs they might handle stuff differently. If that is the case you might get the correct answer from the Template club support.

  Attachments
 
  1. jennix

didn't work on 3.4.1

the line in default.php is now "$canEdit = $this->item->params->get('access-edit');"

replacing it with "$canEdit = false;" in the template override does nothing at all.

  Attachments
 
  1. Heidi Hall

Perfect thanks, very clear. I had to use the 1b option but didn't have to do 3c. I tried a few other options before finding this article and nothing else had worked. I'm on Joomla 3.7.

  Attachments
 
  1. Bastian W.    Heidi Hall

You are welcome, glad to hear it helps :-)

  Attachments
 
  1. laizer

Thanks so much Bastian W.
It worked for me after editing the file under <joomla-root>/templates/<your template name>/html/com_content/article/default.php

  Attachments
 
  1. Bastian W.    laizer

You are welcome

  Attachments
 
There are no comments posted here yet

Leave your comments

Posting comment as a guest.
Attachments (0 / 3)
Share Your Location