Jump to content
adrian

Batch Child Editor

Recommended Posts

Upon a re-import of data (generated originally from BCE's export as csv feature), BCE appears to be treating the related field as type TINYTEXT (limiting to 255 characters), even though the field is defined as type MEDIUMTEXT  (collation: utf8_general_ci).

I've tested this a number of times.   Full paragraphs (i.e. greater than 1000 characters) that I copy into the field's textbox (using page edit) and then save, end up being cut off to 255 characters over and over upon a re-import of data.   Checked CSV and it contains the full paragraph.

Any idea as to why the predefined type is changing upon CSV import?

Share this post


Link to post
Share on other sites

Can this module be used to export pages, add translations for content, and import them?

We have this huge website (over 7000 pages). We've used TextLanguage and TextAreaLanguage fields for all textual fields, and all image and file fields have their own description input boxes for different languages too.

Now we'd need to export all pages and send them to our translator so they can translate all site contents with their specialized programs, and a way to import the translations back to our site alongside the content in original language. Is this possible with BCE?

I've tried to export site contents, but can't figure out a way to include image/file descriptions, or any textual field's contents in other language(s).

This module has already been a huge help when initially building this site in question. We created most of the pages with Ryan's Import Pages from CSV module, and were able to modify them in batches with BCE quite a few times during further development. Massive time savings!

Share this post


Link to post
Share on other sites

Hi!

I'm on 'PW' 3.0.21 with 'BCE' 1.3.0.

As for me 'BCE' in 'Export mode' doesn't shows 'AsmSelect' field to adjust children fields to be exported, as shown in your topic.

So according to the module description I must have

Screen Shot 2015-05-26 at 12.17.17 PM.png

but only get

post-4381-0-75231900-1465646226_thumb.jp

I've also tried to install 'Select Options' fieldtype core module, that enables 'AsmSelect ' fields to be used in templates, but nothing had changed.

Despite of mentioned above, an API exporting still works well.

Share this post


Link to post
Share on other sites

@tkaranka - multi-language is not currently possible, but we do have some functionality for multiple value fields which could be extended to support multilanguage - the catch is that I am not a ML user myself so I am not terribly familiar with it, although I would love to see BCE support it at some point. Either way I am glad it's been a big timesaver for you.

@feniks502 - 

Quote
As for me 'BCE' in 'Export mode' doesn't shows 'AsmSelect' field to adjust children fields to be exported, as shown in your topic.

This option is only available if you define separately configurable pages:

Screen Shot 2016-06-11 at 8.13.49 AM.png

and then you check this on the Settings tab of the page(s) selected above:

Screen Shot 2016-06-11 at 8.15.03 AM.png

But this is only necessary if you them to be able to select the fields to export. You can also define them yourself on the Settings tab of the page, here:

Screen Shot 2016-06-11 at 8.16.06 AM.png

Please let me know if it makes sense now!

Share this post


Link to post
Share on other sites

When creating a bunch of children via CSV the pages aren't active in the alternative languages. Just caught me. 

  • Like 1

Share this post


Link to post
Share on other sites
12 minutes ago, Soma said:

When creating a bunch of children via CSV the pages aren't active in the alternative languages. Just caught me. 

Thanks for the report soma - I really have played with ML much at all - can you give me a quick rundown of what BCE needs to do to make this work as needed?

Share this post


Link to post
Share on other sites

You mean you haven't? Shame on you really!

Well you check for $languages more than 1 and then cycle each and set "status[langid]" to 1. 

  • Like 1

Share this post


Link to post
Share on other sites
Just now, Soma said:

You mean you haven't? Shame on you really!

Well you check for $languages more than 1 and then cycle each and set "status[langid]" to 1. 

True - see I can't even get my only language correct :)

I have played a little with it, but never had a need to actually use it so just wanted clarification from you to save me a little time.

  • Like 3

Share this post


Link to post
Share on other sites

Hi @adrian,

I'm currently trying this module to import my news from my old website to PW (3.0.28). I have 2 questions:

  1. Do I'm suppose to be able to import html? All <h>, <p>, etc are lost when I import. Either by copy-paste the text or using a CSV file. I tried different ways to escape but didn't get it. I also deactivate HTML purifier and some other stuff in input tab of my body field.
  2. I have some glitchs with CSV export in images or files field. I created a mockup page (values were just the title of the field). You will see that in images/files, the content of body is copied. However, if images/files are filled, they export correctly.

Thanks!!

Mel

PS I didn't try yet multilanguages, I hope it works!! ;-)

news.csv

Share this post


Link to post
Share on other sites

Thanks adrian for this excellent module! I used it a lot in my projects.

Recently I upgraded my php version to 7 and found that the Add method and Update method for csv import(both by using textarea and files) failed. Only the title can be saved successfully but not other fields when I am using the Add method. However, I cannot confirm if it is the issue raised from the php upgrade. Just wonder anyone can use this module with php7?

I tried upgrade PW and reinstall the module but no luck. Thanks for reading.

Share this post


Link to post
Share on other sites

Let me reply the above issue by myself.

I have tried using this module with freshly installed php7 and php5.64 xampp. The result is that the Add and Update function using csv is not working in php7 but php5.64. However I am not smart enough to figure out why is this happening. I hope this information is useful to somebody. 

Share this post


Link to post
Share on other sites

Hi @Karl_T and @mel47 - I am very sorry for the lack of response here. I have been low on time lately and spending most of it on TracyDebugger.

@mel47  - I'll look into the html tags being lost on import - any chance you could PM me the file you are trying to import?

@Karl_T - I know what the issues will be - just need to set myself up with a PHP7 testing environment and track them all down.

I'll see what I can do about getting both of these taken care of this week.

Thanks for your patience.

  • Like 3

Share this post


Link to post
Share on other sites

@Karl_T - I think your PHP7 issues should be fixed with the latest version. Please let me know if you find anything else amiss.

@mel47 - any chance of that test file that you are trying to import?

  • Like 2

Share this post


Link to post
Share on other sites
On 7/25/2016 at 8:02 AM, Soma said:

When creating a bunch of children via CSV the pages aren't active in the alternative languages. Just caught me. 

Sorry for the crazy delay on this @Soma but I think it should now all work as expected.

Would there be any reason to make this a config option? Would anyone not want new pages to be automatically activated? Could it be a module-wide setting, or would it need to be part of the interface where the new pages are added?

Share this post


Link to post
Share on other sites
1 hour ago, adrian said:

would it need to be part of the interface where the new pages are added?

I think that it is the best option

  • Like 1

Share this post


Link to post
Share on other sites
Just now, Zeka said:

I think that it is the best option

So to clarify, there are time when you wouldn't want newly added pages automatically activated in all other languages? (Sorry not a ML user so not sure how most people work). Do you think it should be checked or unchecked by default?

@mel47 - I took a look at the html tag issue - was a very easy fix (just committed) - sorry I hadn't come across this before. I was sanitizing as "text" - now I am using the "purify" sanitizer - hopefully that will work for everyone in all scenarios, but if anyone notices a problem, please let me know.

 

  • Like 1

Share this post


Link to post
Share on other sites
1 minute ago, adrian said:

So to clarify, there are time when you wouldn't want newly added pages automatically activated in all other languages? (Sorry not a ML user so not sure how most people work). Do you think it should be checked or unchecked by default?

Yes, you are right. Very often only few pages have translation to all languages. ( Ukraine is not english speaking country and almost all blogs have only about 10% of posts translated to other languages ). 
It should be checked by default, IMHO.

  • Like 1

Share this post


Link to post
Share on other sites

An option when creating would be nice option. It's not always content pages bit also pages as categories etc. Maybe even some field in csv could be used to do it on a per entry basis. I would go for something like this. In the case of such a feature the more option to do such things the better.

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, Zeka said:

Yes, you are right. Very often only few pages have translation to all languages. ( Ukraine is not english speaking country and almost all blogs have only about 10% of posts translated to other languages ). 
It should be checked by default, IMHO.

 

Ok, I have added the checkbox:

Screen Shot 2016-09-06 at 12.02.23 PM.png

4 minutes ago, Soma said:

Maybe even some field in csv could be used to do it on a per entry basis.

Not sure how best to implement this cleanly. If it was a simple matter of checking if there was an additional field at the end of the row that was 1 or 0, that would be ok I guess, but with the CSV field pairing functionality and it's checks, I think it is going to start to get a bit messy, but if you think it would be really worthwhile, let me know and maybe I'll revisit it.

  • Like 2

Share this post


Link to post
Share on other sites

Of course you're right. I think it would be possible but maybe little messy. I'm not into this module much (used it once), but maybe on the child editor some feature for setting the active languages via checkboxes would be a better way?

Share this post


Link to post
Share on other sites
1 minute ago, Soma said:

but maybe on the child editor some feature for setting the active languages via checkboxes would be a better way?

Sounds useful, but I'll wait and see if there is demand. I don't honestly know how many people are using this module anyway, let alone with ML setups.

Share this post


Link to post
Share on other sites

The latest version now uses a proper csv parser, not php's str_getcsv so now it supports line breaks within csv "fields". This should deal with the problem that @elabx reported earlier this year - sorry it's been so long coming.

I'd love to hear how this new parser works out for everyone's CSV importing needs. If it seems good, then I will also start using it in my Table CSV Import/Export module: http://modules.processwire.com/modules/table-csv-import-export/

Thanks for any feedback.

Does anyone else have anything outstanding that needs fixing?

  • Like 3

Share this post


Link to post
Share on other sites

Hi Adrian, thank you so much for the work you put into this module! It's really making life a lot easier.

I've read through this thread and seen that you considered setting the CSV field pairings per template rather than per page. Could you re-consider this option, or point me into the right direction of what I need to tweak to use the module this way? Alternatively it'd already be really helpful if it weren't necessary to add each configurable page separately, but to allow all children, grandchildren etc. of a page to be configurable too.

Since that probably helps understanding my issue, here's a little background: I work with a nested page structure in which the parent (A) has a number of children (B) which I'd like to import. Each of these children (B) will have between, on average, one and ten child elements (C), each of which again has at least one child. The current module settings would require me to add each of the children (B) and grandchildren (C) separately to the list of configurable pages in the module settings. Which also means my colleagues - who're not superusers - cannot import anything but the children on the first level (A) on their own, as they have no access to the module configuration and the settings tab, and B and C are only created with the imports.

(The easiest solution of course would be to import the pages without field pairings. However, that failed on my local testing environment every way I tried it. Even if the fields were all present in the CSV, and in the same order as in the template settings, the title field never imported correctly.)

Share this post


Link to post
Share on other sites

Hi @Naz - glad you like the module and welcome to the forums.

I can totally understand the issue you are having with the way I have the configuration set up. Ideally having it by template would also be useful - unfortunately I don't think it will be a simple change so I am wondering if we can figure out why you are needing the field pairing to be set up if you have matching numbers of fields in the CSV file.

Are you using the latest version of BCE? Could you perhaps send me a test CSV file to work from?

Share this post


Link to post
Share on other sites

@adrian sorry for the delay. I finally was able to test it, and it rocks! html tags are now imported correctly. I still have difficulties with export : when some fields (images or files) are empty, the content of body field is replicated.

Concerning multilanguage, could you give an hint of how to use it? Do I can import in 2 languages at the same time? Anyway, I discovered a workaround couple weeks ago. If I changed default language, I could import in this language. So I will do 2 imports, which is not so bad, considering I planned to used it only once to migrate my website content.

Thanks

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...