How to hide Edit button when viewing an article

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Tue Sep 22, 2015 5:15 am
Reply with quote
Report this post
Hi supporters,

When viewing an article, there is an "Edit" button on the left of the article.

Edit button.jpg


I tried to configure in Joomla but cannot hide that button. Can you please tell me how to hide it?

Thank you and regards,

Hai
User avatar
Gold Boarder

GK User
Tue Sep 22, 2015 7:40 am
Reply with quote
Report this post
Hi
hahah easy... it's only for logged users which have permission to edit.
Check this same link on second browser without login ... and you won't see "edit" link anymore.
--
probably you site is in offline mode so you have to login as a admin, right? :whistle:
User avatar
Platinum Boarder

GK User
Tue Sep 22, 2015 10:47 am
Reply with quote
Report this post
Hi Oscar,

I want to hide the button even when the user has permission to edit. In my website, every user can post and edit articles and they are restricted to some folders only. If they can edit article that way, they can get access to all media folders.

Please help me to remove that button and also eliminate any chance user can get abuse of that button even when it is hidden.

Thank you and regards,

Hai
User avatar
Gold Boarder

GK User
Tue Sep 22, 2015 7:59 pm
Reply with quote
Report this post
We cannot help in Joomla ACL nor K2 ACL settings.
--
but you can delete this edit feature from code.
templates\gk_news2\html\com_content\article\default.php

line 178-179
<li class="itemPrintEmail">
<?php if (!$this->print) : ?><?php if ($params->get('show_print_icon')) : ?><?php echo preg_replace('@<img.*?alt="(.*?)".*?\/>@mis', '$1',JHtml::_('icon.print_popup', $this->item, $params)); ?>, <?php endif; ?><?php if ($params->get('show_email_icon')) : ?><?php echo preg_replace('@<img.*?alt="(.*?)".*?\/>@mis', '$1',JHtml::_('icon.email', $this->item, $params)); ?><?php endif; ?><?php if ($canEdit) : ?>, <?php echo preg_replace('@<img.*?alt="(.*?)".*?\/>@mis', '$1',JHtml::_('icon.edit', $this->item, $params)); ?><?php endif; ?><?php else : ?><?php echo preg_replace('@<img.*?alt="(.*?)".*?\/>@mis', '$1',JHtml::_('icon.print_screen', $this->item, $params)); ?><?php endif; ?>
</li>


If you remove whole code, Print/email/edit links will gone for all users also for hackers
User avatar
Platinum Boarder

GK User
Wed Sep 23, 2015 12:53 am
Reply with quote
Report this post
Thank you Oscar,

There is anyway to keep print and email link? Only remove edit link?

Hai
User avatar
Gold Boarder

GK User
Wed Sep 23, 2015 1:08 am
Reply with quote
Report this post
Hi Oscar,

I cannot find the code in the file: templates\gk_news2\html\com_content\article\default.php.

Please help me to check again.

Thank you and regards,

Hai
User avatar
Gold Boarder

GK User
Wed Sep 23, 2015 8:09 am
Reply with quote
Report this post
You're right , sorry I took code from not this template by first time (News not News2), now is correct.
find this (line ~~274)
<li class="itemEdit">
<?php echo preg_replace('@<img.*?alt="(.*?)".*?\/>@mis', '$1',JHtml::_('icon.edit', $this->item, $params)); ?>
</li>
User avatar
Platinum Boarder

GK User
Wed Sep 23, 2015 8:36 am
Reply with quote
Report this post
Thank you Oscar,

I deleted and it disappeared.
User avatar
Gold Boarder

GK User
Wed Sep 23, 2015 10:05 am
Reply with quote
Report this post
Since now, edition is available only by admin (back-end)
or
you will install component named: User Article Manager (UAM)
User avatar
Platinum Boarder

GK User
Wed Sep 23, 2015 12:15 pm
Reply with quote
Report this post
Yes, I will have to install a 3-party component.
User avatar
Gold Boarder


cron