Jump to content
tpr

Front-End Edit Lightbox (FEEL) for ProcessWire

Recommended Posts

20 hours ago, tpr said:

I'm not sure if it is but possibly yes. Try passing it inside the "overrides" array:

Works like a charm 😉 Thanks!

But i think the "selectorsToHideSuperUser" function don't work properly.

My user has the superuser role, but the tabs are only hidden if I use the option "selectorsToHide", the "selectorsToHideSuperUser" values are ignored.

<?php
// Settings/Delete Tab is VISIBLE with Superuser rights
echo $mycalc->feel(array("text" => "<i class=\"fas fa-edit\"></i>","overrides" => array("selectorsToHideSuperUser" => "#_ProcessPageEditDelete, #ProcessPageEditDelete, #_ProcessPageEditSettings, #ProcessPageEditSettings")));

// Settings/Delete Tab is INVISIBLE with Superuser rights
echo $mycalc->feel(array("text" => "<i class=\"fas fa-edit\"></i>","overrides" => array("selectorsToHide" => "#_ProcessPageEditDelete, #ProcessPageEditDelete, #_ProcessPageEditSettings, #ProcessPageEditSettings")));

 

Share this post


Link to post
Share on other sites

I'm trying to access the feel module from within a custom module but it's throwing a 500 error with "Call to a member function feel() on null " in my module . I'm using $this->page->feel() in my module. Have no idea what is wrong with this? Can't figure out how to get a reference to feel inside the module.

Share this post


Link to post
Share on other sites

I have not done it yet myself, but the following should point you in the right direction:

 

Share this post


Link to post
Share on other sites

Try $this->wire("page")->feel(). It's not FEEL but your $page is not available (null).

Share this post


Link to post
Share on other sites

Hello,

I am still using this module a lot on my site but I would like to avoid the reloadign of the page. Is this possible ?

Let me explain : I use edit links as follow :

	foreach($concernedPages as $p) {
	echo $p->title.' '.$p->feel(array("text"=>"[Edit]", "fields"=>title,image,summary,level"));
	}
	

So as you may imagine, I have a list of pages titles accompanied by an 'Edit' link. When I click this edit link, a lightbox opens up and I can edit the page.and this works fine BUT, when I hit the 'save' button, my lightbox closes and I wish the current page (which is not the page I have just fronend edited) would NOT reload as well.

Would there be a way to test if the current page is the edited one and reload if true, but prevent reloading if false ? Or simpler, just manually set reloading to false when we want it, resulting in the following code :

	echo $page->feel(); // THIS WOULD RELOAD CURRENT PAGE AFTER EDITING
	foreach($concernedPages as $p) {
	echo $p->title.' '.$p->feel(array("text"=>"[Edit]", "fields"=>title,image,summary,level"), 'reload'=>false); // THIS WOULD PREVENT RELOADING (NOTE THE EXTRA PARAMETER ADDED TO ILLUSTRATE MY POINT
	}
	

Thanks for helping !

PS : I hesitated on creating a new post but eventually decided on following this thread (I have read the complete thread but couldn't finc anything concerning my question)

EDIT : Eventually, I guess I've found it myself (and it wasn't so hard) adding this in my main JS file :

	var FEEL = {
    onBeforeReload: function (o) {
                return false;
    }
};
	

Edited by celfred
Answer found :

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.

×
×
  • Create New...