Tuesday, March 19, 2024

How do I turn off front end editing in a Joomla 3.x template?

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.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Stay Connected

35FollowersFollow
- Advertisement -

Latest Articles