Jump to content

select option field is not saving


Recommended Posts

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

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)


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

  • Like 3
Link to comment
Share on other sites

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Similar Content

    • By Mithlesh
      Hi there,

      On my website page: https://www.writerrelocations.com/about-us/governance-team/, attaching the snapshot for your reference: 

      I want the above one should be minimized and maximised when one click on the button(where the name is written); like in the reference below - it is minimized 

      Maximised Option:

      Kindly let me know how can we do the same?
    • By EyeDentify
      I as have been a bit confused for some time about how the "Markup Regions" functionality in Processwire worked.
      But i have know read a bit more and think that i am getting to grips with it. And Markup Regions is going to be huge.

      To aid me in understanding Markup Regions better i started to read the Source code for the new "Regular" theme in conjunction with the Blog about the markup regions.
      It helped me a great deal to understand the basics and more fine details of it.

      A tip is to open both links and use the Source code of the "Regular" theme while reading the blog post.
      The Source code:
      The Blog post:
      I hope this could help others starting out with markup regions.
      Just take it slow and read it a couple a times and soon you will see the greatness of markup regions.

    • By EyeDentify
      Hello Fellow PW Fans and Gurus.

      I have run into a problem where i have created a template without a template file associated with it.
      Now i would like to HAVE a template file associated with it, not an alternate but as the main template file.

      So i thought, that's easy, I upload the template file and change it in template settings but I only get the Alternate template file setting?

      Ok so maybe i can change it via the API , so i wrote some code for this.
      <?PHP function changeTemplate($pages = null, $templates = null) { /* get the pages to change template on */ $logItems = $pages->findMany('template=tmp_log_item'); /* get the template object for our desired template */ $Template = $templates->get('tmp_new_log_item'); foreach($logItems AS $key => $logData) { /* use template object $Template to set template */ $logData->template = $Template; /* save page item */ $logData->save(); } } /* do the magic change */ changeTemplate(); ?> Needless to say, PW was not happy about this, It throw up an error message:
      Error: Exception: Invalid value sent to Page::setTemplate (in /home/virtual/mydomain/public_html/wire/core/Page.php line 1782)
      Now from what i understand i gave $logData->template the wrong type of value.
      So what should the value be to correct this?
      When I read the docs at: https://processwire.com/api/ref/page/
      the value can be "string" or "Template".

      So i gave it a string and it went haywire.

      How should I approach this cause I realy dont want to manually change template file on över 50 plus pages

      Maybe I should use the Template class to create the value that the API wanted, but I am unsure how to use it.

      Thank you for any info you can give me on this.

      If you want more info to help me, ask and I will try my best to give it to you.
      Updated and Solved
      I solved the problem and have updated the code to reflect this.

      Essentialy i used the get() method of $templates to get the template object for my template i wanted to use using the template name.
      I gave the Object to the $logData->template property and all went well.
      We learn something new every day.
      One Note:
      The template file you want to use must have been uploaded and added as a template in the Template section in the Admin for this code to work as expected.
    • By Mustafa-Online
      MBR international is Sudanese mining company. The company aims to maximize shareholder value by through
      exploration and Production of precious metal and industrial mineral, MBR international mining subsidiary was established in 2015, engaged in Industrial Minerals and Metals mining and related activities including explorations, extraction and processing. 


    • By pwuser1
      First I am a PW student I think it's the best PHP Framework.  So please don't get me wrong when I asked when other Frameworks like the big 3 (Wordpress, Joomla, Drupal) are too complicated to use or maintain (I tried them all) why are people still using them? PW is just too elegant in comparison even for a newbie like me.
  • Create New...