WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Droplets & Snippets => Topic started by: RolfP on December 23, 2007, 12:06:27 PM

Title: Edit this page as code snippet module
Post by: RolfP on December 23, 2007, 12:06:27 PM
Hi,

I modified the code posted at http://forum.WebsiteBaker.org/index.php/topic,2352.0.html and created a module.
This module adds an image in template where ever you put the code
<?php frontend_edit(); ?> if the logged in account is allowed to edit the page.

On clicking image the backend editor opens the selected page.

See the attached modul.

Have fun.

Rolf


[gelöscht durch Administrator]
Title: Re: Edit this page as code snippet module
Post by: ruebenwurzel on December 23, 2007, 12:30:00 PM
Hello,

well done, easy to install, very easy to handle. Great snippet.

Thanks for your contribution to WB.

Matthias
Title: Re: Edit this page as code snippet module
Post by: berta on January 04, 2008, 08:30:39 AM
Rolf,
Thank you for your module, it works great, and makes it so much easier to ask other people to edit the pages. THANKS
Berta
Title: Re: Edit this page as code snippet module
Post by: diodak on January 22, 2008, 12:33:15 PM
You didnt notice that front login must be enabled. Good module.
Title: Re: Edit this page as code snippet module
Post by: JonH on January 25, 2008, 01:44:07 PM
Where's the attachment?
Title: Re: Edit this page as code snippet module
Post by: ruebenwurzel on January 25, 2008, 01:50:24 PM
in the first post  :-D
Title: Re: Edit this page as code snippet module
Post by: JonH on January 25, 2008, 03:16:48 PM
I swear it wasn't there before!  :-D
Title: Re: Edit this page as code snippet module
Post by: fsuk on July 18, 2008, 04:32:48 PM
Needs to be updated for 2.7, only works with the default group_id and not the group_ids field. i might give it ago if i have time, that is of couse unless theres a feature like this already built into 2.7??
Title: Re: Edit this page as code snippet module
Post by: fsuk on August 07, 2008, 03:39:24 PM
I have updated the module for WB 2.7 for multiple groups.

Theres probably some redundant code in there.

The updated module is attatched.

[gelöscht durch Administrator]
Title: Re: Edit this page as code snippet module
Post by: aldus on August 07, 2008, 04:04:10 PM
Sorry for the german:
so:
I cleaned it a little bit up ... e.g. no nessesay new database() needed,
and collecting the data before echo.

where are two variables left
- $old_admin_users und
- $admin_users.

both of them are only used one time - and never more; so they can be left/removed.

Regards
Aldus

[gelöscht durch Administrator]
Title: Re: Edit this page as code snippet module
Post by: fsuk on August 07, 2008, 04:10:42 PM
Thanks ill add it to the zip in my previous post
Title: Re: Edit this page as code snippet module
Post by: aldus on August 07, 2008, 04:23:15 PM
But please test it before  :-D
I've made mass. changes ...

Regards
Aldus
Title: Re: Edit this page as code snippet module
Post by: fsuk on August 07, 2008, 04:26:08 PM
Yup it works fine, although i had to remore /n from the end of the Edit Page line as it wasnt starting a new line just printing '/n'
Title: Re: Edit this page as code snippet module
Post by: TN on September 07, 2008, 02:50:17 PM
I swear it wasn't there before!  :-D

You can see the attachment only if you are logged in, if you have cookies allowed und if you have javascript allowed.

I think: not everybody should gets the code   :evil:
Title: Re: Edit this page as code snippet module
Post by: Stefek on September 18, 2008, 09:19:55 PM
Hello!
This is a great upgrade!

I only have one question:
How can I modify the <?php frontend_edit(); ?>
so I get a message when this snippet is not installed.

Thanks in advance.
Stefek
Title: Re: Edit this page as code snippet module
Post by: doc on September 18, 2008, 10:07:05 PM
Hi,

like done for the register_frontend_m odfiles function called in the index.php of the most templates out there, so:

Code: [Select]
<?php
if (function_exists(&#39;frontend_edit&#39;)) {
  
frontend_edit();
} else {
  echo &
#39;Sorry, to use this function, you need to install the code snippet xxx first.&#39;;
}
?>

Regards Christian
Title: Re: Edit this page as code snippet module
Post by: Stefek on September 18, 2008, 10:44:22 PM
Thanks Christian!

Regards,
Stefek
Title: Re: Edit this page as code snippet module
Post by: mr-fan on September 22, 2008, 07:35:09 PM
i have a question about the frontedit...

is it possible to make it easyer for a simple editor, after he made changes to his site, that he can with one click back to frontend.... or is this to complex in the backend....

or is there a other option that makes a sucess from a user to only one site to edit...save and look changes....in the frontend?

mfg mr-fan
Title: Re: Edit this page as code snippet module
Post by: erpe0812 on September 23, 2008, 08:27:04 AM
A click to the button and he turns to the frontend  in new tab (see image)

rgds

erpe

[gelöscht durch Administrator]
Title: Re: Edit this page as code snippet module
Post by: mr-fan on September 23, 2008, 12:20:01 PM
ups.... sry i only used the big red one  :-D

my brain is jumping to fast to think..... :roll:

greets
Title: Re: Edit this page as code snippet module
Post by: jrast on February 23, 2009, 10:59:39 AM
If i want to add a new group, i get this error:
Code: [Select]
Parse error: syntax error, unexpected T_VARIABLE in /home/opentopo/public_html/wb/modules/frontedit2.7/info.php on line 1
So, why do i get a error from a snippet if i want to add a new group in the WB backend? for me a strange thing...

@edit:
ok, Problem found.
the info.php file was in a wrong format and there was no white space betwen the <?php tag and the first variable.
Title: Re: Edit this page as code snippet module
Post by: solbu on March 12, 2009, 08:13:28 PM
This module adds an image in template where ever you put the code
<?php frontend_edit(); ?> if the logged in account is allowed to edit the page.
I have a bug report.
If one use the Search function to search the portal as guest and is not logged in, the Edit link, with the image, shows up regardless of whether one is loged in or not. Clicking the Edit link results in one having to login thou, but still, it should not be displayed.

This only happens on the search page. (websitebakerurl/search/index.php)


I have tried to locate why it show up there as guest, but I am unable to figure it out.
Title: Re: Edit this page as code snippet module
Post by: mr-fan on March 12, 2009, 09:29:47 PM
Quote
I have a bug report.
If one use the Search function to search the portal as guest and is not logged in, the Edit link, with the image, shows up regardless of whether one is loged in or not. Clicking the Edit link results in one having to login thou, but still, it should not be displayed.

This only happens on the search page. (websitebakerurl/search/index.php)

i just have a short try - i don't can confirm this on my site! we have a site with the maincontent is for unregistered/unlogged in users and a short part is for spezial users with login!

i've the frontedit placed in the site - with your report i've tryed out imediatly but no such manner in my case!

mean guest in your case - no login or no access to edit a site??

because if you logged in and have no access to edit site - the fronteditbutton will display anyway...

rgds martin
Title: Re: Edit this page as code snippet module
Post by: solbu on March 12, 2009, 09:46:53 PM
mean guest in your case - no login or no access to edit a site??
Correct. The user is not logged in.
On every page on the site, guest users do not see the image. However if the guest user use the search function, the edit image appears also for guests.

This happens Only on the /search/index.php page, where the search results also apears.
Title: Re: Edit this page as code snippet module
Post by: solbu on March 13, 2009, 02:34:22 PM
On every page on the site, guest users do not see the image. However if the guest user use the search function, the edit image appears also for guests.

This happens Only on the /search/index.php page, where the search results also apears.
I have just noticed another problem, that might help in debugging. Logged in users Do Not get the Edit image on the search page. The site owner noticed it.

We are in the process of launching a new design, using WebsiteBaker for the first time, and are trying various things. :) This is the last remaning bug we need to resolve before we can launch the new CMS.
Title: Re: Edit this page as code snippet module
Post by: Stefek on March 20, 2009, 06:14:40 PM
Logged in users Do Not get the Edit image on the search page.

Hello.
That's because a "searchpage" is not editable, I guess.

BTW.
If you are trying different things, have a look at Droplets.
There is also a droplet for this snippet (edit this page).
However I can't seem to find it on the official Droplets Library:
http://www.websitebakers.com/pages/droplets/official-library.php

Regards and happy baking,
Stefek
Title: Re: Edit this page as code snippet module
Post by: Ruud on March 20, 2009, 10:35:29 PM
Just added this droplet to the library (must have missed it)

http://www.websitebakers.com/pages/droplets/official-library/other/edit-this-page.php

Ruud
Title: Re: Edit this page as code snippet module
Post by: Stefek on March 21, 2009, 12:01:50 AM
Hello Ruud.

Thank you. It's easer to implement as the whole snippet.

BTW. I like the way the single droplets are presentet on the library right now.
Looks good with the built in editor and those additional fields.
:-)

Kindly Regards,
Stefek