Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Add custom user profile fields to New User creation #7966
    lcwlfr
    Participant

    Ok, in one of Steves postings I found the link to version 0.9.9.13
    https://github.com/piklist/piklist/releases/tag/0.9.9.13 and that fixes the issue with value.

    in reply to: Add custom user profile fields to New User creation #7963
    lcwlfr
    Participant

    I am replying to bullet point #2, because I am encountering the same problem:

    value parameter doesn’t seem to wirk inside group fields… It has nothing to do with the select field, but with the fact that it is inside a group field.

    I guess it is a problem with value, since the output of a html field inside a group field only shows the field-label, not the actual html, which is also set using value.

    <?php
    /*
    Title: Page builder
    Post Type: page
    order: 1
    */
    
    // Taken from the Piklist addons demo.
    
       piklist('field', array(
            'type' => 'select'
            ,'field' => 'module_selects'
            ,'label' => 'Select a Module'
            ,'columns' => 12
            ,'value' => 'module' //works!
            ,'choices' => array(
              'none' => 'Select a Module to add'
              ,'module' => 'Editor'
              ,'repeating_module' => 'Repeating Textarea'
            )
          ));
    
       piklist('field', array(
          'type' => 'html'
          ,'label' => 'html field label'
          ,'value' => '<i style="background-color: grey; color: #fff; padding: 5px;">HTML output</i>'
       ));
    
       piklist('field', array(
        'type' => 'group'
        ,'field' => 'module_group'
        ,'label' => 'Page Modules'
        ,'description' => 'Page Modules'
        ,'fields' => array(
          array(
            'type' => 'select'
            ,'field' => 'module_select'
            ,'label' => 'Select a Module'
            ,'columns' => 12
            ,'value' => 'module' //doesn't work inside a group field
            ,'choices' => array(
              'none' => 'Select a Module to add'
              ,'module' => 'Editor'
              ,'repeating_module' => 'Repeating Textarea'
            )
          )
          ,array(
             'type' => 'html'
             ,'label' => 'html field label'
             ,'value' => '<i style="background-color: grey; color: #fff; padding: 5px;">HTML output</i>' //doesn't work inside a group field
          )
          ,array(
            'type' => 'editor'
            ,'field' => 'module_editor'
            ,'columns' => 12
            ,'options' => array(
              'wpautop' => true
              ,'media_buttons' => false
              ,'tabindex' => ''
              ,'editor_css' => ''
              ,'editor_class' => true
              ,'teeny' => false
              ,'dfw' => false
              ,'tinymce' => true
              ,'quicktags' => true
            )
            ,'conditions' => array(
              array(
                'field' => 'module_group:module_select'
                ,'value' => 'module'
              )
            )
          )
          ,array(
            'type' => 'textarea'
            ,'field' => 'module_title'
            ,'label' => 'Module title:'
            ,'columns' => 12
            ,'add_more' => true
            ,'attributes' => array(
              'class' => 'large-text'
              , 'rows' => 2
            )
            ,'conditions' => array(
              array(
                'field' => 'module_group:module_select'
                ,'value' => 'repeating_module'
              )
            )
          )
        
        )
      )); 
    Attachments:
    You must be logged in to view attached files.
Viewing 2 posts - 1 through 2 (of 2 total)