Jump to content

Some tests with frontend inplace / inline edit


pwFoo
 Share

Recommended Posts

As posted at https://processwire.com/talk/topic/8501-problem-with-ajax-jeditable-process-module/ I'm playing around with frontend edit plugins...

While FCM (FrontendContentManager) was a simple frontend form based on PW form api and inputfields now I'm play with inline edit plugins / modules.

Instead of jEditable my last test was based on jQuery inplace edit plugin ("Jinplace").

Jinplace makes a element editable on click and sends object (pageID), attribute (fieldname) and value (the new value) via ajax to a process module.

Features 

  • editable textfield and textarea
  • page reference field as select (drop down)
  • checkbox and labeled checkbox (Yes / No, translateable)
  • a (buggy / testing) jquery tokeninput tagging widget with autocomplete as jinplace plugin/ extension: add, remove and create new tags
    (buggy click to close event, but jinplace plugin is just a first self written testing version)

The process module also take care about

  • missing required values (page id, field name) to identify the field to work with
  • unchanged values (at the moment returns a json error message inside the editable field)
  • not save empty values to required fields
  • input sanitizing
  • save/ create  new tags (pages) via tokeninput fields

ToDo

  • bug fixes (dirty javascript code)
  • tokeninput themes (mac, facebook, default) via parameter and also useable as not editable style in the frontend
  • error handling (show a message, ignore and reset, ...?)
  • sync initial value with "default" return value (initial could be "Like" / "Don't linke" but process module returns true / false or "Yes" / "No"...)
  • file / image fields (maybe should be done with another module and PW inputfields - form with inline ckeditor and hidden image / file upload field)

Bitbucket Repo: https://bitbucket.org/pwFoo/frontendjinplaceedit

Really basic demo!

Login: http://samarium-pit.lightningpw.com/processwire/ as demo / demo123

Testing page: http://samarium-pit.lightningpw.com/frontendjinplaceedit/

Don't know if I'll do some more work to create a full usable module.

But let me know what you think about it  ;)

  • Like 3
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...