Jump to content
apeisa

Fredi - friendly frontend editing

Recommended Posts

Wohoo apeisa hws a new baby! Great to have this!

  • Like 1

Share this post


Link to post
Share on other sites

Hahaa, thanks Soma :) It has little bugs with images/files and haven't even tested it with repeater yet, but other than that it seems to work nicely! This was superfun to code and actually took very little time and code so far.

Share this post


Link to post
Share on other sites

Let pw do its work and youll be fine. :)

Just have to remember to echo it!

Btw what about permissions?

Share this post


Link to post
Share on other sites

Permissions should be fine. I check them on field level.

Marty: feel free to try. I think it might work with thumbnails already. If not, it shouldn't be a big tweak.

  • Like 1

Share this post


Link to post
Share on other sites
Btw what about permissions?

Oh, I had nice bug that showed edit links for everyone (and then login screen if user didn't have editing rights). Fixed now, show edit links are shown only for editors.

Share this post


Link to post
Share on other sites

Ok, just pushed nice little update. It should support pretty much all inputfields now (uses their native input processing). Only thing where I am having problems is ajaxfiles inside repeater (gives me response text: "page not saved (no changes)" after upload has been done). Repeaters without images works just fine.

It should be pretty trivial to build some kind of JS-switch to "show / hide" edit buttons. There is also $fredi->enabled = false that you can set if you want to disable edit links for some reason.

  • Like 1

Share this post


Link to post
Share on other sites

Uh nice,

a lot of little cupcakes inside your code to pick and learn from.

  • Like 1

Share this post


Link to post
Share on other sites

Apeisa i think you have to set some track changes when modifiying repeaters. Am on mobile so cant look.

Share this post


Link to post
Share on other sites

Thanks soma. That is what I have tried, not lucky yet.

Share this post


Link to post
Share on other sites

Does it works with language fields? Because all I get is a "edit" text instead of the body and a edit link.

Share this post


Link to post
Share on other sites

Haven't tested yet. Does it work with others? You have loaded js?

Share this post


Link to post
Share on other sites

Yes I have scripts. I get the link only with no text and if I click it just loads the homepage in the modal.

<span onclick="TINY.box.show({iframe:'http://pwmultilang.ch?id=1001&fields=body&modal=1',boxid:'frediModal',width:750,height:450,fixed:true,maskid:'bluemask',maskopacity:40})" class="fredi fredi-body">edit</span>

Share this post


Link to post
Share on other sites

I also just tested with a non language field and same issue as above. I don't know what is wrong.

Share this post


Link to post
Share on other sites

The url seems to be wrong. Do you have the process module installed? Does this selector work for you: wire('pages')->get("template=admin, name=fredi-field-edit");

Share this post


Link to post
Share on other sites

I just tried on a non language install, and got same issue.

Thanks, yeah it seems the process module doesn't get installed at all. Although it says it installs it, it doesn't.



I installed the proces module and now the edit link works and opens field, but the text still isn't shown/rendered on page...

Share this post


Link to post
Share on other sites

Multilang fields: it has few issues. It shows all languages right, but saves the "default" into "active" language. So if you are currently browsing with default lang, it discards all the changes for alternative languages. If you are browsing in alternative language, it saves default value into it.

Share this post


Link to post
Share on other sites

I'm on a other install with no languages. Still doesn't output the body text when using echo $fredi->body. Just the edit link.

Share this post


Link to post
Share on other sites

I just tried on a non language install, and got same issue.

Thanks, yeah it seems the process module doesn't get installed at all. Although it says it installs it, it doesn't.

That is strange. It is listed as "installs" module, so PW should take care of it. Bug in core or something strange on my install method?

I installed the proces module and now the edit link works and opens field, but the text still isn't shown/rendered on page...

Which text is not shown and where? Editor doesn't load value when editing.

I'm on a other install with no languages. Still doesn't output the body text when using echo $fredi->body. Just the edit link.

Oh, it shouldn't :)

$fredi->body outputs just the link, you render the content yourself with $page->body. This allows you to put the link wherever you like.

Share this post


Link to post
Share on other sites

The body text isnt shown on the page just an edit link instead of the body text.

Ah now I get iz. Think it wasnt too clear about from your example.

Share this post


Link to post
Share on other sites

That is strange. It is listed as "installs" module, so PW should take care of it. Bug in core or something strange on my install method?

Well, the process module doesn't have diabled install button so something is wrong.. :)

ProcessFredi and FrediProcess are different modules, so it can't work ;)

  • Like 1

Share this post


Link to post
Share on other sites

Well, the process module doesn't have diabled install button so something is wrong.. :)

ProcessFredi and FrediProcess are different modules, so it can't work ;)

Oh boy :) Thanks for this.

I have few tweaks coming, so will commit that fix with those.

Ah now I get iz. Think it wasnt too clear about from your example.

I added extra note for this case. Also will make better examples for official readme that is currently baking.

Share this post


Link to post
Share on other sites

Multilang fields should work now too and also fixed the problem with installation.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Gadgetto
      Status update links (inside this thread) for SnipWire development will be always posted here:
      2019-10-18
      2019-08-08
      2019-06-15
      2019-06-02
      2019-05-25
      If you are interested, you can test the current state of development:
      https://github.com/gadgetto/SnipWire
      Please note that the software is not yet intended for use in a production system (alpha version).
      If you like, you can also submit feature requests and suggestions for improvement. I also accept pull requests.
      ---- INITIAL POST FROM 2019-05-25 ----
      I wanted to let you know that I am currently working on a new ProcessWire module that fully integrates the Snipcart Shopping Cart System into ProcessWire. (this is a customer project, so I had to postpone the development of my other module GroupMailer).
      The new module SnipWire offers full integration of the Snipcart Shopping Cart System into ProcessWire.
      Here are some highlights:
      simple setup with (optional) pre-installed templates, product fields, sample products (quasi a complete shop system to get started immediately) store dashboard with all data from the snipcart system (no change to the snipcart dashboard itself required) Integrated REST API for controlling and querying snipcart data webhooks to trigger events from Snipcart (new order, new customer, etc.) multi currency support self-defined/configurable tax rates etc. Development is already well advanced and I plan to release the module in the next 2-3 months.
      I'm not sure yet if this will be a "Pro" module or if it will be made available for free.
      I would be grateful for suggestions and hints!
      (please have a look at the screenshots to get an idea what I'm talking about)
       




    • By eelkenet
      Hi! I've created a small Inputfield module called InputfieldFloatRange which allows you to use an HTML5 <input type="range" ../> slider as an InputField. I needed something like this for a project where the client needs to be able to tweak this value more based on 'a feeling' than just entering a boring old number. Maybe more people can use this so I'm hereby releasing it into the wild.  
       
      What is it?
      The missing range slider Inputfield for Processwire. 
      What does it do?
      This module extends InputfieldFloat and allows you to use HTML5 range sliders for number fields in your templates.
      It includes a visible and editable value field, to override/tweak the value if required.  
      Features
      Min/max values Precision (number of decimals) Steps (Read more) Manual override of the selected value (will still adhere to the rules above) Usage
      Clone / zip repo Install FieldtypeFloatRange, this automatically installs the Inputfield Create new field of type `Float (range)` or convert an existing `Float`, `Integer` or `Text` field. To render the field's value simply echo `$page->field` Demo
      A field with Min=0, Max=1, Step=0.2, Precision=2

      Field with settings Min=0, Max=200, Step=0.25, Precision=2

       
      Todo
      Make the display-field's size configurable (will use the Input Size field setting)  Hopefully become redundant If it's usable for others I'll add it to the Modules list  
      Changelog
      v002
      - Fix issue where setting the step value to an empty value created problem with validation
      - Make the display-field optional 
      v001
      - Initial release
       
      Thanks!
       
       
    • By Robin S
      Another little admin helper module...
      Template Field Widths
      Adds a "Field widths" field to Edit Template that allows you to quickly set the widths of inputfields in the template.

      Why?
      When setting up a new template or trying out different field layouts I find it a bit slow and tedious to have to open each field individually in a modal just to set the width. This module speeds up the process.
      Installation
      Install the Template Field Widths module.
      Config options
      You can set the default presentation of the "Field widths" field to collapsed or open. Field widths entered into the Template Field Widths inputfield are only applied if the Edit Template form is submitted with the Template Field Widths inputfield in an opened state. "Collapsed" is the recommended setting if you think you might also use core inputs for setting field widths in a template context. You can choose Name or Label as the primary identifier shown for the field. The unchosen alternative will become the title attribute shown on hover. You can choose to show the original field width next to the template context field width.  
      https://github.com/Toutouwai/TemplateFieldWidths
      https://modules.processwire.com/modules/template-field-widths/
    • By adrian
      Tracy Debugger for ProcessWire
      The ultimate “swiss army knife” debugging and development tool for the ProcessWire CMF/CMS

       
      Integrates and extends Nette's Tracy debugging tool and adds 35+ custom tools designed for effective ProcessWire debugging and lightning fast development
      The most comprehensive set of instructions and examples is available at: https://adrianbj.github.io/TracyDebugger
      Modules Directory: http://modules.processwire.com/modules/tracy-debugger/
      Github: https://github.com/adrianbj/TracyDebugger
      A big thanks to @tpr for introducing me to Tracy and for the idea for this module and for significant feedback, testing, and feature suggestions.
×
×
  • Create New...