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 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.
    • By adrian
      This module allows you to automatically rename file (including image) uploads according to a configurable format
      This module lets you define as many rules as you need to determine how uploaded files will be named and you can have different rules for different pages, templates, fields, and file extensions, or one rule for all uploads. Renaming works for files uploaded via the admin interface and also via the API, including images added from remote URLs.   Github: https://github.com/adrianbj/CustomUploadNames
      Modules Directory: http://modules.processwire.com/modules/process-custom-upload-names/
      Renaming Rules
      The module config allows you to set an unlimited number of Rename Rules. You can define rules to specific fields, templates, pages, and file extensions. If a rule option is left blank, the rule with be applied to all fields/templates/pages/extensions. Leave Filename Format blank to prevent renaming for a specific field/template/page combo, overriding a more general rule. Rules are processed in order, so put more specific rules before more general ones. You can drag to change the order of rules as needed. The following variables can be used in the filename format: $page, $template, $field, and $file. For some of these (eg. $field->description), if they haven't been filled out and saved prior to uploading the image, renaming won't occur on upload, but will happen on page save (could be an issue if image has already been inserted into RTE/HTML field before page save). Some examples: $page->title mysite-{$template->name}-images $field->label $file->description {$page->name}-{$file->filesize}-kb prefix-[Y-m-d_H-i-s]-suffix (anything inside square brackets is is considered to be a PHP date format for the current date/time) randstring[n] (where n is the number of characters you want in the string) ### (custom number mask, eg. 001 if more than one image with same name on a page. This is an enhanced version of the automatic addition of numbers if required) If 'Rename on Save' is checked files will be renamed again each time a page is saved (admin or front-end via API). WARNING: this setting will break any direct links to the old filename, which is particularly relevant for images inserted into RTE/HTML fields. The Filename Format can be defined using plain text and PW $page variable, for example: mysite-{$page->path} You can preserve the uploaded filename for certain rules. This will allow you to set a general renaming rule for your entire site, but then add a rule for a specific page/template/field that does not rename the uploaded file. Just simply build the rule, but leave the Filename Format field empty. You can specify an optional character limit (to nearest whole word) for the length of the filename - useful if you are using $page->path, $path->name etc and have very long page names - eg. news articles, publication titles etc. NOTE - if you are using ProcessWire's webp features, be sure to use the useSrcExt because if you have jpg and png files on the same page and your rename rules result in the same name, you need to maintain the src extension so they are kept as separate files.
      $config->webpOptions = array(     'useSrcExt' => false, // Use source file extension in webp filename? (file.jpg.webp rather than file.webp) ); Acknowledgments
      The module config settings make use of code from Pete's EmailToPage module and the renaming function is based on this code from Ryan: http://processwire.com/talk/topic/3299-ability-to-define-convention-for-image-and-file-upload-names/?p=32623 (also see this post for his thoughts on file renaming and why it is the lazy way out - worth a read before deciding to use this module). 
       
       
      NOTE:
      This should not be needed on most sites, but I work with lots of sites that host PDFs and photos/vectors that are available for download and I have always renamed the files on upload because clients will often upload files with horrible meaningless filenames like:
      Final ReportV6 web version for John Feb 23.PDF

×
×
  • Create New...