Frontend button to edit page if logged-in as admin
Frontend button to edit page if logged-in as admin
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!
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
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.
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.
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: Frontend button to edit page if logged-in as admin
Check out the CGActionBar module.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Frontend button to edit page if logged-in as admin
Or the simple version http://www.cmscanbesimple.org/blog/floa ... -edit-link
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Re: Frontend button to edit page if logged-in as admin
@Rolf: Thanks for the code, works great
.

Re: Frontend button to edit page if logged-in as admin
Thanks to calguy1000, he wrote itflmm wrote:@Rolf: Thanks for the code, works great.

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Re: Frontend button to edit page if logged-in as admin
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
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? 


"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: Frontend button to edit page if logged-in as admin
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...
It's not that, I just disabled it and tried, still no go...
Re: Frontend button to edit page if logged-in as admin
Upgrade FF!
it did it for me. I just don't know why it blocked me before though...

"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: Frontend button to edit page if logged-in as admin
Dr.CSS wrote:Rolf must be mad at me...
As if that would be possible...

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Re: Frontend button to edit page if logged-in as admin
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.calguy1000 wrote:Check out the CGActionBar module.
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
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: Frontend button to edit page if logged-in as admin
Works fine for me, just tested.The CGActionBar does not seem to work with V.2.0.1.1
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: Frontend button to edit page if logged-in as admin
It took about 2 minutes to fix the edit-content thing for 2.0.
Will release in the next few days.
Will release in the next few days.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.