Jump to content

pwfans

Members
  • Posts

    46
  • Joined

  • Last visited

Posts posted by pwfans

  1. Just found this module, match to project needs, thanks a lot.

    Questions on frontend :
    1. Is it possible to show allowed roles / username for each page protected ?
    2. Or displaying allowed pages for roles / username.
    3. What is $page->prohibited use for ?

  2. On 9/2/2021 at 1:19 PM, pwfans said:

    Confirmed, i have this warning too, using csv upload and text, pw 3.0.184 and module 1.08, import result seem on and off, some not imported

    Update, error line 515 happen only when updating value, using csv upload method or paste in method, the value seem updated tho.

  3. On 8/24/2020 at 2:01 AM, Pip said:

    Hi everyone!

    Was wondering if anyone been getting this error when you import? 
     

    Been scratching my head on this. Checked 515 and this is what I got. 

    		if($page->id && count($page->get('ImportPagesCSVData'))) {

    Any idea what's tripping it? 
     

    Confirmed, i have this warning too, using csv upload and text, pw 3.0.184 and module 1.08, import result seem on and off, some not imported

  4. On 5/22/2013 at 4:18 AM, renobird said:

    Thanks Wanze,

    I managed to get it sorted out.

    $n = 1;
    $type = "expense$n";
    $desc = "desc$n";
    $amount = "amount$n";
    $pm = "method$n";
    
    $expenses = $p->travel_expense; // the repeaters    
    foreach ($expenses as $expense){
    
        $rp = $pages->get("id=$expense->id"); // the repeater page we want to update
        $rp->of(false);
    
        // update repeater fields
        $rp->expense_type = $input->post->$type;
        $rp->expense_description = $sanitizer->text($input->post->$desc);
        $rp->expense_amount = filter_var($input->post->$amount,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
        $rp->payment_method = $input->post->$pm;
    
        // save the repeater page
        $rp->save();
    
        // update counter etc
        $n++;
        $type = "expense$n";
        $desc = "desc$n";
        $amount = "amount$n";
        $pm = "method$n";  
    } 

    Is it possible to update current value while also add new item (if any) for current repeater using dynamic row ?

  5. On 5/20/2020 at 3:18 AM, neonwired said:

    I have a front end form for creating new pages, repeater and repeater matrix field don't seem to save any data. I was considering handling the data manually but can't seem to get anything useful from the post data, are there any methods i can use?

    You need creating form using dynamic row

    <input type="text" name="fieldname[]">

    Then, using this php code to fill the repeaters

    <?php
    $fields = count($_POST['fieldname']);
    $p = new Page(); 
    $p->template = 'template_name'; 
    $p->parent = $pages->get('/parent_name/');  
    $p->name = 'page-name';
    for ( $i=0;$i<$fields;++$i ) {
      $repeater = $p->repeater_name->getNewItem();
      $repeater->field_in_repeater = $input->post->fieldname[$i];
      $repeater->save();
    }
    $p->save();

     

    • Like 1
  6. 15 hours ago, adrian said:

    But how nice would that interface actually be for hundreds / thousands of pages? What sort of bulk edit actions are you referring to? Changing status, or deleting etc? I suppose there could be a way to select all across all pages if they were to be paginated. I'm afraid I just don't see it as the right tool for the job in this case, but if you want to add support for this, I'm happy to accept a PR.

    For example, sometimes we need to change title/name/template for about 80 pages from about 600+ pages.
    We use PW for intranet application.
    Thank you for your offer anyway @adrian, we will discuss this with our IT staff first.

  7. 16 hours ago, adrian said:

    @pwfans - I always disable BCE for pages that have too many children for the edit mode to handle. I don't really think the edit mode makes much sense with that many pages anyway so I don't think pagination will help. If you need to batch edit that many child pages you probably need to write a script via the API (Tracy Console panel or AdminActions perhaps?) to make the changes.

    Ahh ok, too bad BCE can't handle many pages, it's already has a nice interface for bulk edit. 

  8. Hello,
    On my PW tree, some of parents have thousands child pages, and some tens of thousands child pages, using BCE load child pages is heavy and cannot using edit mode because of error memory/timeout.
    Is that possible to add pagination like on edit mode just like lister mode ? or is there any way to use this module with thousands child pages ?

     

  9. Site B get data from site A using :

    $items = $siteA->pages->find("parent=/productA/,limit=10");
    foreach ($items as $item) {
    ....
    }
    $items->renderPager();

    Pagination displayed correctly but they page number path also goes to siteA, which is off course not work when clicked. 
    How to do this pagination properly in multi-instance ? thanks

  10. On 10/17/2018 at 7:36 PM, charger said:

    Did anyone else encounter problems with `show()` and `download()`? If I use them, all I get is blank pages resulting in an invalid PDF. The `save()` function works as expected though.

    I’m running PW 3.0.98 with PHP 7.1.12 and RockPdf 1.0.1

    For anybody facing this problem which in my case invalid pdf will generate error  "one or more XREF chunks were not found".
    Solved it by placing the rockpdf instance php code block on top of anything else.

  11. I also thinking about how to "reset" page ID, in my case after web development finish, there are thousand pages used while at development stage for testing, database backup module from ryan give a very convenience way to "reset/back to safe point" but it s not bulletproof solution in my case, restoring database backup will also delete all pages, templates, fields that need to used after development finished.

    Now i use recycle way, i unpublished those redundant pages, and make API used them first whenever need new page until those redundant page all use up.

  12. php code to create multiple pages :

    if ($input->post->submit) {
      $amount = count($input->post->field_1); 
      for($i=0;$i<$amount;$i++) {
        $p = new Page(); 
        $p->template = "template_1";  
        $p->parent = wire('pages')->get("/parent_1/");  
        $p->title = $input->post->field_1[$i];
        $p->name = $input->post->field_1[$i]; 
        foreach ($input->post->field_2 as $result) {
          $p->text.= $result." "; 
        }
        $p->save();
      }  
    } 

    html code :

    <tr>
      <td><input type="text" name="field_1"></td>
      <td>
        <select name="field_2[]" multiple="multiple">
          <option value="opt_1">opt_1</option>
          <option value="opt_2">opt_2</option>
          <option value="opt_3">opt_3</option>
        </select>  
      </td>
    </tr>
    
    <tr>
      <td><input type="text" name="field_1"></td>
      <td>
        <select name="field_2[]" multiple="multiple">
          <option value="opt_1">opt_1</option>
          <option value="opt_2">opt_2</option>
          <option value="opt_3">opt_3</option>
        </select>  
      </td>
    </tr>
    
    ... and another <tr>..</tr> addition using javascript 

    There is off course incorrect value on field_2, they will contain same data get from field_2 on first row.
    Have try on google search and not found any solution yet, there are talk about multi-dimensional array but still not understand how to implement that.

  13. Using page reference field to get some users under certain role:
    - At input tab, i select "Custom find" to query users under certain roles.

    Problem is: for user_1 which is not superuser, above field doesn't work, page reference content not displayed.
    However if i give superuser role to user_1, above field work like expected which of course, i don't want to give superuser role to user_1.

    I already tried check all permissions available to user_1 and add custom predefined system permissions (user-admin-all, user-admin-[role]), still doesn't work.

×
×
  • Create New...