apeisa

Fredi - friendly frontend editing

Recommended Posts

Martin thanks for your answer. In the first case where I get the link plus the modal window with all the fields here the changes get recorded. In the second issue when I m not logged with the superuser. There u don't see the edit link. But with that same user, if log in in admin I can make change to the users because I gave that role the right to modify users. You think in that case there could be some different control applied from the front end?

Share this post


Link to post
Share on other sites

Could there be a problem if i call fredi more than once on a page?

PW dev 2.6.13 - debug mode on - actual fredi

on all templates i use fredi for the whole page like this:

<?php //in <head>
if($page->editable() && $user->isLoggedin()) {
	echo $fredi->renderScript();
}
?>

<?php //in <body>
if($page->editable() && $user->isLoggedin()) {
	echo $fredi->setText("Edit")->hideTabs("children|delete|settings|history")->renderAll();
}
?>

and in one template where i render events - i want to edit the single events - and since i have no "single-event-view" and only the "events" page i've tryed to render Fredi within the loop on every event item like this:

	//get all events and render list - events is set in events.php
	foreach ($events as $e) {
                //some markup and vars....

		//create event html output
		echo '<article class="tline-box '.$class.'"> <span class="'.$span.'"></span><br>';
			//if editable show editlink to the event page
			if($page->editable() && $user->isLoggedin()) {
				echo $fredi->setText("Edit")->hideTabs("children|delete|settings|history")->renderAll($e);
			}

			//rest of markup....

and it works like it should so far - but it doesn't save the changes?

- generated link points to the right page_id's

- popup edit modal shows the right entry

- could easy edit all things

but at the end the event isn't changed - no error - no hint?

wrong token, id, pageobject i've no glue?

Best regards mr-fan

Share this post


Link to post
Share on other sites

i forgot a nice to know.

the first renderFredi link on the whole page don't save simple changed on the events page, too!

so every fredi link get's renders correct - but no one seems to save the changes...so not only the links on the different events don't work the fredi link that works on all other pages like it should didn't work on this page where i've more than one fredi link....

Share this post


Link to post
Share on other sites

OK i figured it out while reducing the options....

so this wont work:

$fredi->setText("Edit")->hideTabs("children|delete|settings|history")->renderAll($e);

while this works:

$fredi->setText("Edit")->hideTabs("children|delete|settings")->renderAll($e);

it was the history tab that cases the no-data-saved problem.

This tab is generated from the version control module....so i will have to take a look into hiding this tab somewhere else or change fredi.

so this is solved - sorry for fast posting before better researching...

Best regards mr-fan

Share this post


Link to post
Share on other sites

Hi there. New to PW but plenty of other CMS experience. Loving PW so far so thank you folks!

I've installed Fredi on PW 2.6.1 and using it to create and modify pages just fine. The plan is to let 'front end' users add, modify and delete their own adverts to a site that I'm building.

It's all working as planned except the follow up when deleting a page. On clicking the delete tab, checking the confirmation box and finally clicking 'Delete Permanently' the modal confirms (admin style) that the page has moved to trash and then shows the page tree within the modal. As this is a front end delete I'd really like the modal to close and return to a certain page at that point (e.g. a list of the users other adverts).

So, my question is...is the page tree view after delete expected behaviour or am I doing something wrong?

Code for delete button as I'm using it is:

echo $fredi->hideTabs("content|children|settings")->setText("Delete This Advert")->setClass("btn btn-primary")->render("title|vendor|price|body|page_image");

Many thanks in advance. Have already learned a huge about about PW from everyones helpful posts!

  • Like 1

Share this post


Link to post
Share on other sites

Hello @ all

As I wrote in an earlier post (https://processwire.com/talk/topic/3265-fredi-friendly-frontend-editing/?p=100192): Fredi doesnt grab or save files or images if they are inside a repeater field - can anyone confirm this behavior or ist this only in my case?

If the file type field or image type field is outside the repeater field and the settings are on multiple files it is not a problem.

Strange behaviour: If I call a page via a pagetable field it always grabs and saves the file/image in a repeater field

Best regards.

Share this post


Link to post
Share on other sites

Hi,

I'm new to PW and recently I discovered »Fredi«. This is really a cool feature, especially with all those additional options. 

I installed it, everything works fine, but the backend page doesn't open in a lightbox as shown in the screenshots and some screencasts. When I click on »Edit« I'm directed to my backend. After changing the content and clicking on »Save« I have to use the back arrow from the browser to go back to the front-end.

Is this a normal situation?

Nikolai

Share this post


Link to post
Share on other sites

How can I prevent the redirect when I add a new page with the Fredi Module?

Here is my Code-Snippet:

$fredi->setText("<i class='fa fa-plus'></i> $page->title erfassen")->addPage("user", "title|pass|email|roles|admin_theme|select_organiser|language", $pages->get(29));
Edited by LostKobrakai
Merged into support topic

Share this post


Link to post
Share on other sites

No one?

The problem is that when I save the page, it redirects to the page that doesn't exist on the front-end because it has no template file.

Share this post


Link to post
Share on other sites

hi,

Coming back on the issue I raised in a post above regarding using Fredy to edit users.

Just wanted to say that the permission control problem I mentionned above (ie edit field not appearing for user with a edit role for that page). Isn't  occuring anymore. I don't know what I did differently but it's working now. Sorry for this.
However the first problem I was mentioning is still there : in a form to edit a user profile, I can't target the fields I want in the edit form.  with this: echo $fredi->email($student); I get a form with all the fields of the template. If I test the same on a page (not from the user template) it works fine the modal only displays the fields I targeted.
Any clue ?

I am running this on the latest dev (PW2.6.21, php 5.4.42). 

Share this post


Link to post
Share on other sites

I found a problem saving changes with fredi.

I have the settings-tab hidden. The page has the hidden-flag on. After saving my changes to some text-fields with fredi, the hidden-flag is automatically set off.

If I set the settings-tab visible, the hidden-flag doesn't change its status on save. 

Fredi is version 1.2.0 and PW 2.6.21.

Share this post


Link to post
Share on other sites

Hi all,

PW: 2.7.2

Fredi: 1.2.0

Fredi working great on pages for me but not for $user :-(

I have a page called 'My Profile' on the front-end of a site. The page is access controlled so that only a logged in user can see it and, thus, the logged in $user can see their own info. Other than that it's a normal content page that echos various parameters (name, address, email etc.) that are assigned to the logged in user.

Heres an example of what's on that page (this works):

echo "<span>Your company name: </span>" . $user->user_company_name . "<br />";

I'd like to add a link on this page to call a Fredi modal to change the users own info. So, I call this:

echo $fredi->renderAll($user); 

(I'll edit settings on the Fredi call to set link text, field to edit etc later)

Sadly no link appears :-(

So, I added the following code into the page to see what permissions the logged in user had for their $user 'page':

foreach ($permissions as $perm) {
if ($user->hasPermission($perm, $user)) {
echo $perm->title . "<br />";
}
}
 
I get this (as expected based on permissions for template):
 
Edit an advert
Delete pages - (for adverts)
Edit pages
View pages
User can update profile/password
Administer users
 
Then I changed the second line of the code above to see what permissions the $user has for the actual page (rather for the $user):
 
if ($user->hasPermission($perm, $page)) {
 
I get the same permissions echoed.
 
So what am I doing wrong??? I can't get a Fredi link to edit the $user no matter what I do. I've even tried this when logged in as the superuser and still nothing.
 
Any help really appreciated. Thank you :-)
Edited by prestoav
Moved to the respective module's topic

Share this post


Link to post
Share on other sites

@prestoav 

Please consider using the code blocks the forum does provide instead of bold text. This will make easier for all of us. 

Hi LostKobrakai, thanks I hadn't spotted that facility. Now edited accordingly :-)

Share this post


Link to post
Share on other sites

Some of my users are reporting an issue where they click on the link to activate Fredi, and instead of getting the form in a dialog box, they are presented with just a blank dialog box (they see the spinner but then just a blank box). I can see further back in this thread that there was a similar issue a long time ago but I assume that has now been solved.  I've tried it on multiple devices and browsers here and have only managed to reproduce the problem once (on that occasion clearing the browser cache solved the problem but I've asked my users who have the problem to do this and in some cases it has solved the problem but in some cases the problem then recurs the next time they click the Fredi link.

Any thoughts on what might be going wrong are welcome.

My code to call fredi is:

 

<a onclick='fredi.modal("http://www.aaa.com/processwire/fredi-field-edit/?id=<?php echo $mypage->id; ?>&frediFields=title|post_description|linked_ruins|post_images|hashtag&hideTabs=children|delete|settings&modal=1"); return false;' 
														 href="http://www.aaa.com/processwire/fredi-field-edit/?id=<?php echo $mypage->id; ?>&frediFields=title|post_description|linked_ruins|post_images|hashtag&hideTabs=children|delete|settings&modal=1" >Click here to add a new image</a>

I've changed the domain name in the posted code as the site owners don't want their domain open to the public yet.

Share this post


Link to post
Share on other sites

Hi, maybe someone tried this before me:

Do you think I could get fredi working inside hannacode?

I'm trying to use it as usual but I get an error message:

Error: Call to a member function render() on a non-object

$members = wire('pages')->find("parent=/members/, location=$office, include=hidden");
foreach ($members as $member) {
    echo $fredi->render('title|headline|mobile|mail', $member);

Without the fredi code everything works as expected.

Could anyone point me to the right direction? Obviously I must do something wrong. Thanks

Share this post


Link to post
Share on other sites

Hantzweb, hard to say, I have never seen that behavior. Let me know if you find a way to reproduce it.

Jozsef, you probably need to load Fredi wire("modules")->get("Fredi")

Share this post


Link to post
Share on other sites

Hantzweb, hard to say, I have never seen that behavior. Let me know if you find a way to reproduce it.

Jozsef, you probably need to load Fredi wire("modules")->get("Fredi")

Thanks Apeisa, I had to add $fredi = wire("modules")->get("Fredi") to the hannacode even though it was in the template file too. It works now.

Share this post


Link to post
Share on other sites

Hi Guys,

First of, this is a great module! Realy nice :) But I have a few issues using this module and was wondering if you guys could help me out.

I implemented it using: 

$username = $user->name;
$another_page = $pages->find("template=user, name={$username}")->first;
echo $fredi->render("name|zzp_profiel_omschrijving", $another_page);

- This works perfectly when logged in as Admin, but not as a different user Role even though I added edit pages and edit profile

to it's permissions. The edit button disappears in it's entirety when I'm logged in as a Superuser.

- Also, this outputs all fields added to a user, not just the ones I specified ( name and zzp_profiel_omschrijving )

- Furthermore I was wondering if there is a way to embed the edit fields directly onto a page, without the edit buttons.

So you would just get a page on the fontend with the field of the backend?

Thanks a lot! :)

Gr Bram

Share this post


Link to post
Share on other sites

Some of my users are reporting an issue where they click on the link to activate Fredi, and instead of getting the form in a dialog box, they are presented with just a blank dialog box (they see the spinner but then just a blank box). I can see further back in this thread that there was a similar issue a long time ago but I assume that has now been solved.  I've tried it on multiple devices and browsers here and have only managed to reproduce the problem once (on that occasion clearing the browser cache solved the problem but I've asked my users who have the problem to do this and in some cases it has solved the problem but in some cases the problem then recurs the next time they click the Fredi link.

Any thoughts on what might be going wrong are welcome.

My code to call fredi is:

<a onclick='fredi.modal("http://www.aaa.com/processwire/fredi-field-edit/?id=<?php echo $mypage->id; ?>&frediFields=title|post_description|linked_ruins|post_images|hashtag&hideTabs=children|delete|settings&modal=1"); return false;' 
														 href="http://www.aaa.com/processwire/fredi-field-edit/?id=<?php echo $mypage->id; ?>&frediFields=title|post_description|linked_ruins|post_images|hashtag&hideTabs=children|delete|settings&modal=1" >Click here to add a new image</a>

I've changed the domain name in the posted code as the site owners don't want their domain open to the public yet.

Hantzweb - did you ever resolve the issue with users seeing blank modal? I'm getting the same thing reported now the development site has moved to a www domain rather than the dev one. They (3 users) were seeing it OK on the dev domain but now just get a blank modal when they click to edit.
 
Sadly I can't replicate the issue on any browser here but three independent users have he same issue so I know it's real!
 
The only pointer I have so far is a report of 'Publisher does not allow it to be displayed in a frame' on IE. This looks like an x-frame-options issue from a bit of Googling, possibly in my case after the domain move?

Share this post


Link to post
Share on other sites
Hantzweb - did you ever resolve the issue with users seeing blank modal? I'm getting the same thing reported now the development site has moved to a www domain rather than the dev one. They (3 users) were seeing it OK on the dev domain but now just get a blank modal when they click to edit.
 
Sadly I can't replicate the issue on any browser here but three independent users have he same issue so I know it's real!
 
The only pointer I have so far is a report of 'Publisher does not allow it to be displayed in a frame' on IE. This looks like an x-frame-options issue from a bit of Googling, possibly in my case after the domain move?

OK, I think I found the problem for my installation. The browser was remembering the password even though the site had been moved between two sub domains (from a dev.mydomain.com to a www.mydomain.com). We needed to delete browsing history, cookie and passwords from the browser before the modal displayed again. This was true in Chrome on Windows and Safari on a Mac.

>>> UPDATE <<<

I thought I'd cracked this but apparently not. A completely new user this morning has the same issue in Both Chrome and Firefox on a Win 7 PC. :-(

Share this post


Link to post
Share on other sites

Hi everyone,

I'm using Fredi to let users add advert to a site. It works fine for adding/editing pages but how can I get it to accept images uploaded in one step?
The page must be saved first so the image is not saved when the user saves the page the first time.

Any tips? Maybe a two step process? Tabs? I'm in the dark...

Share this post


Link to post
Share on other sites

Hi everyone,

I'm using Fredi to let users add adverts to a site. It works fine for adding/editing pages but how can I get it to accept images uploaded in one step?
The page must be saved first so the image is not saved when the user saves the page the first time.

Any tips? Maybe a two step process? Tabs? I'm in the dark…

I'm using this code that works great for adding the page, but how to hook into save the page before the user uploads an image?

 $fredi = $modules->get("Fredi");
 $content .= $fredi->setText("Sell a dress")->setClass("link-button")->addPage("dress", "title|body|images|price|brand|colour|size|condition|length|style|contact|phone|email|county", $pages->get(1243));

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By flydev
      PulsewayPush
      Send "push" from ProcessWire to Pulseway.
       
      Description
      PulsewayPush simply send a push to a Pulseway instance. If you are using this module, you probably installed Pulseway on your mobile device: you will receive notification on your mobile.
      To get more information about Pulseway, please visit their website.
      Note
      They have a free plan which include 10 notifications (push) each day.
       
      Usage
      Install the PulsewayPush module.
      Then call the module where you like in your module/template code :
      <?php $modules->get("PulsewayPush")->push("The title", "The notification message.", "elevated"); ?>  
      Hookable function
      ___push() ___notify() (the two function do the same thing)
       
      Download
      Github:  https://github.com/flydev-fr/PulsewayPush Modules Directory: https://modules.processwire.com/modules/pulseway-push/  
      Examples of use case
      I needed for our work a system which send notification to mobile device in case of a client request immediate support. Pulseway was choosen because it is already used to monitor our infrastructure.
      An idea, you could use the free plan to monitor your blog or website regarding the number of failed logins attempts (hooking Login/Register?), the automated tool then block the attacker's IP with firewall rules and send you a notification.
       

       
      - - - - - - - - - - - - - -
      11-22-2017: added the module to the modules directory
       
    • By netcarver
      Part 1 of a 2 part Module & Service Reveal.
      I'm currently working on a new module: ModuleReleaseNotes that was inspired by the work I originally did on making Ryan's ProcessWireUpgrades module "release" aware. In the end, I decided to ditch the approach I was originally taking and instead work on a module that hooked in to the UpgradeConfirmation dialog and the module edit page.
      Aims
      My aims for this module are as follows...
      Make discovery of a module's changes prior to an upgrade a trivial task. Make breaking changes very obvious. Make reading of a module's support documentation post-install a trivial task. Make module authors start to think about how they can improve the change discovery process for their modules. Make sure the display of information from the module support files/commit messages doesn't introduce a vulnerability. Looking at these in turn...
      Making discovery of a module's changes prior to upgrade a trivial task.
      This is done by adding a "What's changed section" to the upgrade confirmation dialog.  This section takes a best-effort approach to showing what's changed between the installed version and the updated version that's available via the module repository.
      At present, it is only able to talk to github-hosted repositories in order to ask them for the release notes, the changelog file (if present) and a list of commits between the git tag that matches the installed version and the tag matching the latest version.
      It will display the Release Notes (if the author is using the feature), else it will display the commits between the tags (if tagging is used by the module author) else it will show the changelog file (if present) else it will show the latest N commits on the master branch (N, of course, being configurable to your liking.)
      An example of the Github Release Notes pulled in for you, taken from Mike Rockett's TextformatterTypographer Module...

      An example of a tag-to-tag commit list from the same module...

      An example of a changelog - formatted to show just the changes (formatting styles will change)...

      Finally, an example of a fallback list of commits - sorry Adrian ...

       
      Making breaking changes obvious.
      This is currently done by searching for a set of configurable search strings. Later versions may be able to support breaking change detection via use of Semantic Versioning - but this may require some way of signalling the use of this versioning standard on a module-by-module basis.
      For now, then, you can customise the default set of change markers. Here I have added my own alias to the list of breaking change markers and the changes section of the changelog is styled accordingly (these will be improved)...

       
      Make reading of a module's support documentation, post-install, a trivial task.
      This is done by making some of the support files (like the README, CHANGELOG and LICENSE files) readable from the module's information/settings screen. There is an option to control the initial open/closed state of this section...

      Here is Tracy's README file from within the module settings page... 

       
      Make module authors start to think about how they can improve the change discovery process for their modules.
      There are notes in each of the sections displayed on the upgrade confirmation page that help authors use each of the features...

       
      Make sure display of external information doesn't introduce a vulnerability.
      This is an ongoing concern, and is the thing that is most likely to delay or prevent this module's release lead to this module's withdrawl should a vulnerability be found. Currently, output is formatted either via Markdown + HTML Purifier (if it was originally a Markdown file) or via htmlspecialchars() if it has come from a plaintext file.
      If you discover a vulnerability, please get in contact with me via the forum PM system.
       
      Ongoing...
      For now, I've concentrated on integration with GitHub, as most people use that platform to host their code. I know a few people are hosting their repositories with BitBucket (PWFoo comes to mind) and some with GitLab (Mike Rockett?) and I would eventually like to have adaptor implementations for these providers (and perhaps GitKraken) - but for now, GitHub rules and the other hosts are unsupported.
       
      Links
      Github: ModuleReleaseNotes
      PW Module Repository: Here
    • By FrancisChung
      Hi,
      I was wondering if anyone knew what this did? 

      If so, do you know what modules it actually impacts? Is there another log that lists the action it took?

      I'm having some weird problems with PHP duplicate declaration per link below, since this module was run.
       
       
    • By tpr
      AdminOnSteroids
      Various admin tweaks to enhance ProcessWire admin.
      http://modules.processwire.com/modules/admin-on-steroids/
      https://github.com/rolandtoth/AdminOnSteroids