This topic contains 0 replies, has 1 voice, and was last updated by  strarsis 2 years, 9 months ago.

  • Author
    Posts
  • #8255

    strarsis
    Participant

    Hi,

    I just discovered Piklist and it is really great and basically the thing I was searching for – giving me the features of plugins like ACF but still the flexibility of PHP code.
    Let’s hope Piklist will be further developed and maintained for a long, long time. 🙂

    I want a repeating/loop/”add more” field with items that each have a post-relate field.

    I tried the following code (how sleek and beautiful Piklist code is!)

    /*
    Title: Test
    Post Type: parent-post
    */
    
    piklist('field', array(
      'type' => 'group'
      ,'field' => 'items'
      ,'label' => 'Items'
      ,'add_more' => true
      ,'fields' => array(
        array(
          'type' => 'text'
          ,'field' => 'field-1'
          ,'label' => 'Field 1'
          ,'value' => ''
        )
        ,array(
          'type' => 'post-relate'
          ,'scope' => 'post'
          ,'template' => 'field'
        )
      )
    ));
    

    While the normal text field is in each “add more” item, the post-relate field is shown only once below all the “add more” items.
    What could be wrong with the code above – how can I have a post-relate field per “add more” item?

    I also attached a screenshot.

    Thanks in advance and
    with best regards

    Attachments:
    You must be logged in to view attached files.

You must be logged in to reply to this topic.