Jump to content

Recommended Posts

Posted

I'm trying to save a select field with single select option but after clicking on save button i got error page, data in select options is more than 6000

 

10.50.200.58 processwire setup field save.png

Posted

You have more than 6000 options in the select field? I would say if that's the case you should switch to using Pages and Page Reference. 

  • Like 2
Posted

@Tom. yes more than 6000, basically i'm select option is holding all airport  city code like 'LHR,DXB,LAX etc..'. for page references do i need to create 6000 pages?

Posted
2 hours ago, zaib said:

@Tom. yes more than 6000, basically i'm select option is holding all airport  city code like 'LHR,DXB,LAX etc..'. for page references do i need to create 6000 pages?

I would encourage to do that, it also means you can use something like Page Auto Complete so you don't have to scroll through a huge dropdown trying to find the airport you are looking for but instead you can just type it out. 

  • Like 3
Posted

The easiest is probably to use a module like this https://modules.processwire.com/modules/import-pages-csv/

To avoid timeout errors, you maybe have to split your data into smaller chunks, and/or temporarily increase PHP script execution time + memory.

Writing a script yourself would look a bit like this (of course you'd have to hold your data in an array and do a foreach)

https://processwire-recipes.com/recipes/create-page-via-api/

Helper library for parsing CSVs: https://github.com/parsecsv/parsecsv-for-php

  • Like 3
Posted

@adrian's Admin Actions module is a good starting point as well, take a look at source code files, most of them are short and good examples how to work with the API, you can create your own "action" and run from the admin if you want to:

 

  • Like 1
Posted
13 hours ago, zaib said:

@dragan how can i create 6k pages with AP, is there any processwire module ? can you help me in this.

thank you.

I would go with the import option in BatchChildEditor (https://processwire.com/talk/topic/6102-batch-child-editor/)

12 hours ago, dragan said:

Helper library for parsing CSVs: https://github.com/parsecsv/parsecsv-for-php

Batch Child Editor makes use of this library.

  • Like 1

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