Jump to content

Batch Child Editor


adrian

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
Link to comment
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!

Link to comment
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!

Link to comment
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.

Link to comment
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
Link to comment
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.

Link to comment
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
Link to comment
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.

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
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!

Link to comment
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
Link to comment
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!

Link to comment
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
Link to comment
Share on other sites

  • 4 weeks later...

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
Link to comment
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
Link to comment
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
Link to comment
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. 

Link to comment
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
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
×
×
  • Create New...