Page 1 of 1
Frontend button to edit page if logged-in as admin
Posted: Fri Oct 02, 2015 8:35 am
by geotek
When will it be possible to quickly edit a page via an edit button / link at the frontend page if logged in as admin-user at the backend? This is a standard feature on all major CMSes, as it saves a lot of time and should be easy to implement.
Due to removal of the {edit} tag and the editcontent.php script it seems we have lost this capability in V.2.0.
Please (!!!!!!) give us back this valuable feature!
Re: Frontend button to edit page if logged-in as admin
Posted: Fri Oct 02, 2015 12:54 pm
by flmm
Never used this, but I think you want a edit button that links to the page in cmsms backend? You can use your browser cookie and the content_id for this.
Check if the cookie is present and show the button:
{if $smarty.cookies._sx_ != ''}show{/if}
The link url:
{root_url}/admin/editcontent.php?_sx_={$smarty.cookies._sx_}&content_id={$content_id}
With a bit of inline styling to have at the right top of the page and open in new tab:
{if $smarty.cookies._sx_ != ''}<a href="{root_url}/admin/editcontent.php?_sx_={$smarty.cookies._sx_}&content_id={$content_id}" style="position:absolute;top:0;right:20px;background:#fff;padding:8px 15px;border:1px #ddd dotted;margin-top: -2px;color:#333;z-index:9999;" target="_blank">edit</a>{/if}
You can put this in a Global Content Block and put this GCB before the <__body> tag in your template(s).
Update: Sorry, see that they changed the url's, cookies etc. in 2.0. Will try to get it working there as soon as I have 2.0 working.
Re: Frontend button to edit page if logged-in as admin
Posted: Fri Oct 02, 2015 2:23 pm
by calguy1000
Check out the CGActionBar module.
Re: Frontend button to edit page if logged-in as admin
Posted: Fri Oct 02, 2015 2:40 pm
by Rolf
Re: Frontend button to edit page if logged-in as admin
Posted: Fri Oct 02, 2015 3:01 pm
by flmm
@Rolf: Thanks for the code, works great

.
Re: Frontend button to edit page if logged-in as admin
Posted: Fri Oct 02, 2015 5:28 pm
by Rolf
flmm wrote:@Rolf: Thanks for the code, works great

.
Thanks to calguy1000, he wrote it

Re: Frontend button to edit page if logged-in as admin
Posted: Sat Oct 03, 2015 5:00 pm
by Dr.CSS
Rolf must be mad at me, that link does a '403 Forbidden' for me, his whole site does...
Re: Frontend button to edit page if logged-in as admin
Posted: Sat Oct 03, 2015 5:04 pm
by Jo Morg
Not just you

... but I think it has to do with either a particular version of FF, or a plugin of it... I can access with any other browser, or by changing my current FF User Agent... probably a scrip that tries to redirect mobiles, or something?

Re: Frontend button to edit page if logged-in as admin
Posted: Sun Oct 04, 2015 7:26 pm
by Dr.CSS
AH, I just installed adblocker plus to try to cut down on crap loading in the background on sites, might have something to do with it...
It's not that, I just disabled it and tried, still no go...
Re: Frontend button to edit page if logged-in as admin
Posted: Sun Oct 04, 2015 11:32 pm
by Jo Morg
Upgrade FF!

it did it for me. I just don't know why it blocked me before though...
Re: Frontend button to edit page if logged-in as admin
Posted: Tue Oct 06, 2015 12:15 pm
by Rolf
Dr.CSS wrote:Rolf must be mad at me...
As if that would be possible...

Re: Frontend button to edit page if logged-in as admin
Posted: Tue Oct 06, 2015 3:11 pm
by geotek
calguy1000 wrote:Check out the CGActionBar module.
The CGActionBar does not seem to work with V.2.0.1.1. After installing CGActionBar all frontend webpages are blank and appear only after an explicit F5 refresh. Tested with a clean V.2.0.1 installation upgraded to V.2.0.1.1.
The Edit Button code at
http://www.cmscanbesimple.org/blog/floa ... -edit-link mentioned by Rolf does not work either because editcontent.php is no longer available in CMSMS V.2.0
Re: Frontend button to edit page if logged-in as admin
Posted: Tue Oct 06, 2015 3:32 pm
by calguy1000
The CGActionBar does not seem to work with V.2.0.1.1
Works fine for me, just tested.
Re: Frontend button to edit page if logged-in as admin
Posted: Tue Oct 06, 2015 3:38 pm
by calguy1000
It took about 2 minutes to fix the edit-content thing for 2.0.
Will release in the next few days.