Jump to content
adrian

Batch Child Editor

Recommended Posts

Same here, 2.6.17 + latest BCE dev and no issues, except the shift-click one and sortable table headers.

The latter could be removed using "$table->setSortable(false);" in the module, if not required. Header items are still clickable though (because the CSS cursor: pointer).

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for those reports - The problems you were having is due to the new AJAX loading of the Children tab in recent dev versions of PW. I had fixed that in the dev version of BCE, but never ported back to master.

I am testing your checkbox toggles here and they work great, but a couple of things need fixing. In the screenshot you'll see that the checkbox is above the column header label - seems to be an issue when the title/name of the child page is really long. 

post-985-0-22979300-1442246345_thumb.png

The other more important issue is that the checkboxes don't get loaded when using the new AJAX load option in BCE:

post-985-0-40152100-1442246457_thumb.png

BTW, the AJAX open option is really only useful if you are placing BCE in a new tab or in an inline fieldset in the Content tab, because the Children tab is already AJAX in PW dev.

Would you mind having a look at these and sending me a PR on the dev branch?

Thanks again!

PS I'll look into the issue of the clickable, but not sortable table header links!

Share this post


Link to post
Share on other sites

I'm not sure if that's a Lister issue, but by default the pages should really be sorted by "sort" and not "-modified", which makes less sense in the module's context.

Edit: It would also be nice if there would be a way to exclude some fields (e.g. mode) from the new save-reminder functionality.

Just an FYI - the latest dev version now has the default sort in Lister mode set to "sort" - should be a nicer, more consistent experience!

Share this post


Link to post
Share on other sites

Yeah, that's better for sure. But I'm still wondering, why sorting isn't changeable via a filter.

Ok, you can now define the default sort order in the config settings.

However there is still a problem with adding a sort filter to override the default sort order. On my end at least, this seems to be a problem with Lister itself - I can't add a sort filter for a standard lister. Maybe something wrong with my pW sandbox installation. I will need to investigate this further a little later - no more time right now.

Share this post


Link to post
Share on other sites

Maybe something wrong with my pW sandbox installation. I will need to investigate this further a little later - no more time right now.

Not a problem with your installation. I think it's a problem of lister in general.

Share this post


Link to post
Share on other sites

The other more important issue is that the checkboxes don't get loaded when using the new AJAX load option in BCE:

This should be fixed now. Please stop adding that much features  :P

In the screenshot you'll see that the checkbox is above the column header label - seems to be an issue when the title/name of the child page is really long.

It was an easy fix, adding white-space: nowrap to the thead. At least that was the easiest solution and I don't see any drawbacks.

Clicking on the thead items could replace the header checkboxes, question is that the sort feature will remain or not.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks @tpr - I have merged your changes so this functionality is now available on the dev branch of BCE. I really appreciate your work on this!

As for the table sort feature - it would be nice to have this working - I will add to my list of things, but I am pretty short on time at the moment, but again, PR's are most welcome ;)

Given the bugs with the sort handles and the Add New button with stable BCE and dev PW, I would like to merge BCE dev to stable fairly shortly, so if anyone has noticed any other issues, especially with the new Lister mode, the new Inline Fieldset position option, and also the alternative Parent Page option (under the Content / Deletion / Protection settings tab), please let me know.

I do have some tweaks I would still like to make to the Lister mode - mainly getting the "Add New" button to work - I have disabled this for the moment because there are target issues with PW modals when called from inside iframes that I need to figure out, but I still think the current dev version of BCE is now more stable given that so many of us are using the dev version of PW.

Share this post


Link to post
Share on other sites

Actually just created a new PR - row deletion was buggy, it just toggled states instead of setting/unsetting all rows for deletion. Sorry for the inconvenience.

Thanks for your work!

  • Like 1

Share this post


Link to post
Share on other sites

Actually just created a new PR - row deletion was buggy, it just toggled states instead of setting/unsetting all rows for deletion. Sorry for the inconvenience.

Thanks for your work!

Thank you - it's been merged !

  • Like 1

Share this post


Link to post
Share on other sites

And another brick to the wall: setting column header checkboxes based on column items. If all items checked (or marked for deletion), the "check all" column checkbox gets checked. State is also set on loading BCE.

post-3156-0-57070400-1442344607_thumb.gi

  • Like 2

Share this post


Link to post
Share on other sites

Thanks again @tpr - very nice!

I have merged those changes and also merged the dev version of BCE into master. I do have a few more ideas/tweaks to implement, but I'll be working on the master branch again for now.

Note - for those using the new BCE with PW stable I have had to disable the new Lister mode as it won't work properly on PW stable.

Now that this new version is being pushed out through PW module upgrades and lots more users will be using it, please let me know if anyone discovers any issues.

Share this post


Link to post
Share on other sites

Any known limitations with the number of pages/fieldtypes? I'm trying to export a CSV of 400 pages, 25 fields per page. Field types include Title, Checkbox, Page, Text, Options, Page, MapMarker, Textarea, Image, Rangeslider, Datetime and Options.

Exporting a CSV seems to fail, no error message/log as far as I can see though.

Share this post


Link to post
Share on other sites

@ZGD - you are not the first to report this:  https://processwire.com/talk/topic/6102-batch-child-editor/?p=97690

I have my PHP settings (memory, execution time, etc) high enough that I haven't seen this, so the quick fix is to make those adjustments at your end. 

I do however have it on my list to modify the export script so it works in batches so this won't be necessary - thanks for the reminder!

Share this post


Link to post
Share on other sites

some actual testing with BCE get me

Notice: Undefined index: parentPage in S:\DEV\www\xxx\site\modules\BatchChildEditor\BatchChildEditor.module on line 303

Notice: Undefined index: parentPage in S:\DEV\www\xxx\site\modules\BatchChildEditor\BatchChildEditor.module on line 384

Notice: Undefined index: parentPage in S:\DEV\www\xxx\site\modules\BatchChildEditor\BatchChildEditor.module on line 1746

Notice: Undefined index: listerDefaultSort in S:\DEV\www\xxx\site\modules\BatchChildEditor\BatchChildEditor.module on line 1804

PW 2.6.19 - BCE 0.9.9 - local - usage is in the content tab

Best regards mr-fan

  • Like 1

Share this post


Link to post
Share on other sites

Hi @mr-fan,

I think those notices were just a side effect of upgrading from an older version of BCE, but regardless I just committed some changes that should fix them - thanks!

Please let me know if you come across any others.

PS - thanks for all your support for this module - both testing and promoting it in other threads!

Share this post


Link to post
Share on other sites

All notices are gone! ....and i know i owe you the next german translation... :rolleyes: (coming next week for shure)

PS - thanks for all your support for this module - both testing and promoting it in other threads!

This is as a matter of course if i use a module like yours in my projects!

Getting such modules with great support from expirienced developers is a real good thing and my opinon is that even if i don't could code such thing myself i've to support/test/translate or do something else that contributes and honor the author.

(Finally "Opensource" is like sharing time and experience at the same time to benefit - and it only really works if the most participants take part of that game)  added: i've less experience so i'll bring in my time...;)

Best regards mr-fan

Edited by mr-fan
  • Like 1

Share this post


Link to post
Share on other sites

Hi everyone,

New version committed to the dev branch which adds some interesting new features. I have had some clients confused by the use of child pages for repeatable elements. I know we have PageTable, but a couple of versions ago in BCE I introduced the ability to embed the editor within the Content tab (or a new tab, etc). This provides an alternate interface for editing child pages within the parent page. I think this was useful (and has become my default over PageTables). It can be especially cool in Lister mode where you can have inline ajax editing of child pages.

This new version adds the ability to hide the child pages from the Page Tree and and also if you want, to hide the Children Tab. This means that clients have no idea that the content is stored in child pages. I know that you can also do this with an external page tree for PageTables, but that hidden "black box" still makes me a little uncomfortable at times, so this is a bit of a best of both worlds. 

The only catch with the hiding of child pages in the Page Tree is the count of child pages. To make it work I needed to make the core Page::numChildren method hookable. I have asked Ryan if he'd be willing to do that in the core, but for now if you want this feature to work properly, you will need to make this change yourself.

Here are some screenshots of the new options and functionality.

Two new settings:

post-985-0-19449100-1446199219_thumb.png

Note that the About page has no children listed:

post-985-0-67000800-1446199209_thumb.png

Child pages are editing within the content tab, but nowhere else because the Children tab is also hidden:

post-985-0-59257800-1446199223_thumb.png

  • Like 3

Share this post


Link to post
Share on other sites

hi adrian,

that is great!! i was also a little uncomfortable with the pagetable and external parent setup. are there any issues regarding pagination or will this also be solved when numChildren is hookable?

Share this post


Link to post
Share on other sites

Bernhard - that's a good question.

In general hiding pages in the Page Tree can be problematic with child count and pagination, but I don't think this will be a problem for BCE given that when it hides pages it hides all the children of the page (not a select list). That said, this new feature is not well tested yet (which is why it is in the dev branch), but I am implementing it on a live site in the next day or two, so it will get some good testing pretty soon.

Give it a go and let me know what you find - I am undecided at the moment if this is a good idea or a bit of a hack, but I really like the way it looks and works!

  • Like 1

Share this post


Link to post
Share on other sites

I love what you're doing here Adrian! It does raise some concerns, but I'm sure it's not too serious :)

I think the children shouldn't be hidden for superuser, have you thought of that possibility? Would actually be nice if you could choose to which roles they will be hidden.

  • Like 1

Share this post


Link to post
Share on other sites

I love what you're doing here Adrian! It does raise some concerns, but I'm sure it's not too serious :)

I think the children shouldn't be hidden for superuser, have you thought of that possibility? Would actually be nice if you could choose to which roles they will be hidden.

I definitely thought about not hiding the children for superusers - just didn't worry about it too much for this first version. Determining which roles they are hidden for is definitely another option. The config settings for this module are definitely getting complex - maybe I have already passed a critical feature-bloat point, but I definitely see your point. 

The main thing I want to improve on is the Lister mode option in this new scenario - I think that it is the most powerful and unique option due to the inline ajax editing - the only catch at the moment is that it is embedded in an iframe (like Ryan did with newish Template > Usage lister. The inline ajax editing works awesome (if you have Lister Pro), but right now Add New and modal editing don't work. I will try to tackle these again shortly. 

Share this post


Link to post
Share on other sites

Just a quick screenshot of the Lister mode in action - note that I have toggled editing on for the first "Story"

post-985-0-63545300-1446234449_thumb.jpg

  • Like 1

Share this post


Link to post
Share on other sites

Just a quick FYI - thanks to a tip from Ryan I have been able to remove the need for making the numChildren method hookable, so if you are interested in the new features on the dev version for hiding the children from the page list view, go take a look now - no need for the core modifications.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks Adrian, great module!

I'm trying to use it to export users page into csv, but the module doesn't show in "Users" parent page.

Is there a way to make it work?

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 gebeer
      I am happy to present my new fieldtype FieldtypeImageFromPage. It is made up of 2 modules:
      Fieldtype Image Reference From Another Page is a Fieldtype that stores a reference to a single image from another page. The image can be selected with the associated Inputfield.
      Inputfield Select Image From Page is an Inputfield to select a single image from images on a predefined page and it's children.
      And there also is a helper module that takes care of cleanup tasks.
      This module evolved out of a discussion about my other Module FieldtypeImagePicker.  It caters for use cases where a set of images is being reused multiple times across a site. With this fieldtype these images can be administered through a chosen page. All images uploaded to that page will be available in the inputfield.
      When to use ?
      Let editors choose an image from a set of images that is being used site-wide. Ideal for images that are being re-used across the site.
      Suited for images that are used on multiple pages throughout the site (e.g. icons).
      Other than the native ProcessWire images field, the images here are not stored per page. Only references to images on another page are stored. This has several advantages:
      one central place to organize images when images change, you only have to update them in one place. All references will be updated, too. (Provided the name of the image that has changed stays the same) Features
      Images can be manipulated like native ProcessWire images (resizing, cropping etc.) Image names are fully searchable through the API Accidental image deletion is prevented. When you want to delete an image from one of the pages that hold your site-wide images, the module searches all pages that use that image. If any page contains a reference to the image you are trying to delete, deletion will be prevented. You will get an error message to help you edit those pages and remove references there before you can finally delete the image. How to install and setup
      Download and install this module like any other modules in ProcessWire Create a page in the page tree that will hold your images. This page's template must have an images field Upload some images to the page you created in step 2 Create a new field. As type choose 'Image Reference From Another Page'. Save the field. In 'Details' Tab of the field choose the page you created in step 2 Click Save button Choose the images field name for the field that holds your images (on page template from step 2) Click Save button again Choose whether you want to include child pages of page from step 2 to supply images Add the field to any template You are now ready to use the field View of the inputfield on the page edit screen:

      View of the field settings

      The module can be installed from this github repo. Some more info in the README there, too.
      In my tests it was fairly stable. After receiving your valued feedback, I will eventually add it to the modules directory.
      My ideas for further improvement:
      - add ajax loading of thumbnails
      Happy to hear your feedback!
       
    • By gebeer
      Although the PW backend is really intuitive, ever so often my clients need some assistance. Be it they are not so tech savvy or they are not working in the backend often.
      For those cases it is nice to make some help videos available to editors. This is what this module does.
      ProcessHelpVideos Module
      A Process module to display help videos for the ProcessWire CMS. It can be used to make help videos (screencasts) available to content editors.
      This module adds a 'Help Videos" section to the ProcessWire backend. The help videos are accessible through an automatically created page in the Admin page tree. You can add your help videos as pages in the page tree. The module adds a hidden page to the page tree that acts as parent page for the help video pages. All necessary fields and templates will be installed automatically. If there are already a CKEditor field and/or a file field for mp4 files installed in the system, the module will use those. Otherwise it will create the necessary fields. Also the necessary templates for the parent help videos page and it's children are created on module install. The module installs a permission process-helpvideos. Every user role that should have access to the help video section, needs this permission. I use the help video approach on quite a few production sites. It is stable so far and well received by site owners/editors. Up until now I installed required fields, templates and pages manually and then added the module. Now I added all this logic to the install method of the module and it should be ready to share.
      The module and further description on how to use it is available on github: https://github.com/gebeer/ProcessHelpVideos
      If you like to give it a try, I am happy to receive your comments/suggestions here.
    • By Robin S
      A module created in response to the topic here:
      Page List Select Multiple Quickly
      Modifies PageListSelectMultiple to allow you to select multiple pages without the tree closing every time you select a page.
      The screencast says it all:

       
      https://github.com/Toutouwai/PageListSelectMultipleQuickly
      https://modules.processwire.com/modules/page-list-select-multiple-quickly/
    • By gebeer
      Hello all,
      sharing my new module FieldtypeImagePicker. It provides a configurable input field for choosing any type of image from a predefined folder.
      The need for it came up because a client had a custom SVG icon set and I wanted the editors to be able to choose an icon in the page editor.
      It can also be used to offer a choice of images that are used site-wide without having to upload them to individual pages.
      There are no image manipulation methods like with the native PW image field.
      Module and full description can be found on github https://github.com/gebeer/FieldtypeImagePicker
      Kudos to @Martijn Geerts. I used his module FieldTypeSelectFile as a base to build upon.
      Here's how the input field looks like in the page editor:

      Hope it can be of use to someone.
      If you like to give it a try, I'm happy to hear your comments or suggestions for improvement. Eventually this will go in the module directory soon, too.
    • By bernhard
      @Sergio asked about the pdf creation process in the showcase thread about my 360° feedback/survey tool and so I went ahead and set my little pdf helper module to public.
      Description from PW Weekly:
       
      Modules Directory: https://modules.processwire.com/modules/rock-pdf/
      Download & Docs: https://github.com/BernhardBaumrock/RockPDF
       
      You can combine it easily with RockReplacer: 
      See also a little showcase of the RockPdf module in this thread:
       
×
×
  • Create New...