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

Alright! I can't wait to try this Antti. Quick question: will it let me work with your Thumbnails module too?

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

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 Macrura
      Field Descriptions Extended
      This module enables you to extend field descriptions by dividing short descriptions with a longer text that is revealed in a toggle.
      Modules Directory: http://modules.processwire.com/modules/field-descriptions-extended/
      Github: https://github.com/outflux3/FieldDescriptionsExtended
      Extending your field descriptions using the standard field's description field.
      Once this module is installed, it will automatically search your description field for the presence of 5 dashes (-----).
      Any content above the 5 dashes will be visible and the content below the dashes will be hidden. A 'More...' link will appear at the end of the short description which when clicked will reveal the rest of the description.
      Using Simple Markdown Editor with the description field
      If you have Simple Markdown Editor (InputfieldSimpleMDE) installed, you can enable the field description to have that editor.
      *When using Simple MDE, you can use the button (Insert Horizontal Line) instead of typing 5 dashes. More about SimpleMDE.
      Extending your field descriptions using content from a ProcessWire Page for the field description.
      You may use the content from a ProcessWire page as a field description. This would allow you to easily insert images, links, and use hanna codes.
      To use page content for your field descriptions, please follow these instructions:
      Install Select Fields module (FieldtypeFields) http://modules.processwire.com/modules/fieldtype-fields/ Create a new field using this field type, e.g. field_select. Add the field to any template you will be using for your field descriptions. Setup your help pages (for example under a settings branch) where you will store the field description content,using the template containing the Field Select. Add content to a page and select the field where that content should show. To show a short text before the link to the longer content, separate them with 5 dashes Be sure to update your settings on this page, first enable page content descriptions,then specify the name of the Select Fields field, template to search, and content field. If you create a field description using this method, please note that the description field must be blank for contexts where you want the page content to appear.
      You can freely use template context for field descriptions, but the Page Content method is not context sensitive and will display under all contexts where the description is blank.
      ----
      original post:
      This is a new module, hope to release soon, which allows extended field descriptions, in currently 2 ways.
      The main feature of the module is that you can have a short description and then a 'more...' link which drops down a longer block of text.
      This is achieved by separating the intro/visible text and the rest with 5 dashes.

      Example setup:

      the 2nd way is if you are using AdminThemeUiKit, you can show extended field instructions in a panel. The content of the panel is edited on a regular PW page. This use case would probably not be that common, but if you had a field that required some extended instructions for how to use, this could be useful; Also, since this allows you to target information and instructions down at the field level, it could reduce the amount of documentation needed on a global level, since it is a lot more context targeted.

    • By Robin S
      Breadcrumb Dropdowns
      Adds dropdown menus of page edit links to the breadcrumbs in Page Edit.

      Installation
      Install the Breadcrumb Dropdowns module. The module requires ProcessWire >= v3.0.83 and AdminThemeUikit.
      There is a checkbox option in the module config that determines if the breadcrumb dropdowns will include pages that the user does not have permission to edit.
      Features/details
      The module adds an additional breadcrumb item at the end for the currently edited page. That's because I think it's more intuitive for the dropdown under each breadcrumb item to show the item's sibling pages rather than the item's child pages. In the dropdown menus the current page and the current page's parents are highlighted in a crimson colour to make it easier to quickly locate them in case you want to edit the next or previous sibling page. If the option to include uneditable pages is selected then those pages are indicated by a reduced text opacity and the "not-allowed" cursor is shown on hover. There is a limit of 25 sibling pages per dropdown for performance reasons and to avoid the dropdown becoming unwieldy. Incompatibilities
      This module replaces the AdminThemeUikit::renderBreadcrumbs method so will potentially be incompatible with other modules that hook the same method.
       
      https://modules.processwire.com/modules/breadcrumb-dropdowns/
      https://github.com/Toutouwai/BreadcrumbDropdowns
    • By joshuag
      Hey guys, 
      Thought I would share a quick preview of Designme. A module we (Eduardo @elabx and I) are building for visually laying out your templates/edit screens. 🙂
      This is a really quick, zero polish screen grab. FYI. 
      Video #2 - UPDATE
      This new video shows the following features in Designme:
      Re-arranging fields via Drag & Drop Re-sizing fields via Dragging. Adjusting field settings - with live refresh. Working on "hidden" fields while Designme is active. Creating New fields. Deleting fields. Creating/Deleting Tabs. Dragging fields between tabs. Creating fieldsets. Tagging/Un-tagging fields. Fields without headers expand when hovered (like checkboxes). Live filtering of fields in the sidebar. Ability to adjust (all) Template settings without leaving Designme. Template File Tree Editing Template files source code with ACE Editor. Editing Multiple files with ACE Editor. (New Tabs) Saving files. Techie stuff Fields load their own js/css dependancies. *ready to use on creation (*most fields)  Everything happens via Ajax to ProcessPageEdit (via module + hooks). Designme has a JS api that you can use.  All actions trigger events.  We would love any detailed feedback on what you see so far. If you are interested in testing Designme. Let me know below. 🙂
       
       
      Video #1. 
       
    • By dreerr
      TemplateEnginePug (formally TemplateEngineJade)
       
      This module adds Pug templates to the TemplateEngineFactory. It uses https://github.com/pug-php/pug to render templates.
      doctype html html(lang='en') head meta(http-equiv='content-type', content='text/html; charset=utf-8') title= $page->title link(rel='stylesheet', type='text/css', href=$config->urls->templates . 'styles/main.css') body include header.pug h1= $page->title if $page->editable() p: a(href=$page->editURL) Edit Project on GitHub: github.com/dreerr/TemplateEnginePug
      Project in modules directory: modules.processwire.com/modules/template-engine-pug/
       
      For common problems/features/questions about the Factory, use the TemplateEngineFactory thread.
       
    • By tpr
      ProcessNetteTester
      Run Nette Tester tests within ProcessWire admin.
      (continued from here)

      Features
      AJAX interface for running Nette Tester tests, in bulk or manually display counter, error message and execution time in a table run all tests at once or launch single tests show formatted test error messages and report PHP syntax errors stop on first failed test (optional) hide passed tests (optional) display failed/total instead passed/total (optional) re-run failed tests only (optional) auto scroll (optional) include or exclude tests based on query parameters start/stop all tests with the spacebar reset one test or all tests (ctrl+click) https://modules.processwire.com/modules/process-nette-tester/
      https://github.com/rolandtoth/ProcessNetteTester