Title: Multilines
Last modified: August 31, 2016

---

# Multilines

 *  [roundsquaredk](https://wordpress.org/support/users/roundsquaredk/)
 * (@roundsquaredk)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/multilines/)
 * Hi,
 * Love the plugin1.
 * I’m using the plugin to create a menu in pdf.
    I wanna create my own template.
   But when multiple checkboxes has been marked and its generating the pdf, all 
   the data is on one line seperated by a comma.
 * How can I change this into multiline?
 * So instead of my data is like: One, Two, Three
    It should be: One Two Three
 * It’s not an option to just pick every merge tag in the checkbox field and print
   the pdf.
 * [https://wordpress.org/plugins/gravity-forms-pdf-extended/](https://wordpress.org/plugins/gravity-forms-pdf-extended/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Jake Jackson](https://wordpress.org/support/users/blue-liquid-designs/)
 * (@blue-liquid-designs)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/multilines/#post-7014042)
 * I’m glad to hear you find the software useful.
 * To achieve what you want you’ll need to use the `$form_data` array instead. It’s
   a pretty easy change:
 *     ```
       <?php
       echo implode( '<br>', $form_data['field'][20] ); //change 20 to your checkbox field ID
       ?>
       ```
   
 * [More info about the $form_data array can be found in our documentation](https://developer.gravitypdf.com/documentation/custom-templates-with-form-data-array/).
 *  Thread Starter [roundsquaredk](https://wordpress.org/support/users/roundsquaredk/)
 * (@roundsquaredk)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/multilines/#post-7014066)
 * I cant get it to work.
    Would u mind to take a look? [http://madhytten.dk/?gf_pdf=1&fid=1&lid=23&template=buffet-template.php&data=1](http://madhytten.dk/?gf_pdf=1&fid=1&lid=23&template=buffet-template.php&data=1);
 *     ```
       [products] => Array
               (
                   [33] => Array
                       (
                           [name] => Mad til festen
                           [price] => 0,00 kr.
                           [price_unformatted] => 0.00
                           [options] => Array
                               (
                                   [0] => Array
                                       (
                                           [field_label] => Antal kød
                                           [option_name] => 2 slags kød (175 kr)
                                           [option_label] => Antal kød: 2 slags kød (175 kr)
                                           [price] => 175
                                           [price_formatted] => 175,00 kr.
                                       )
   
                                   [1] => Array
                                       (
                                           [field_label] => Vælg kød (2 slags)
                                           [option_name] => Oksemørbrad med stegte svampe, bagte hvidløg og timian
                                           [option_label] => Vælg kød (2 slags): Oksemørbrad med stegte svampe, bagte hvidløg og timian
                                           [price] => 20
                                           [price_formatted] => 20,00 kr.
                                       )
       ```
   
 * Here i want to get the data from all the “option_name”.
    How to do that?
 *  Thread Starter [roundsquaredk](https://wordpress.org/support/users/roundsquaredk/)
 * (@roundsquaredk)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/multilines/#post-7014072)
 * I figured out to use:
    `$form_data['products'][33]['options'][13][option_name]`
   To get the a product. But again its on one line.
 * But when i use your code:
    `echo implode( '<br>', $form_data['products'][33]['
   options'][13][option_name] );`
 * It doesn’t show anything?
 * Then i tried the loop
 *     ```
       <?php
       /* loop through all products */
       foreach($form_data['products'] as $product) {
       ?>
           <?php echo $product['name']; ?>
           <?php echo $product['price']; ?>
           <?php echo $product['quantity']; ?>
           <?php echo $product['subtotal_formatted']; ?>
           <br>
       <?php
           /* Inner loop to loop through options field */
           foreach($product['options'] as $option) {
           ?>
               <?php echo $option['field_label']; ?>
               <?php echo $option['option_name']; ?>
               <?php echo $option['option_label']; ?>
               <?php echo $option['price_formatted']; ?>
               <br>
           <?php } /* close option loop */ ?>
       ?>
       <?php } /* close foreach loop */ ?>
       ```
   
 * But here I can’t exclude some of the option names.
 *  Plugin Author [Jake Jackson](https://wordpress.org/support/users/blue-liquid-designs/)
 * (@blue-liquid-designs)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/multilines/#post-7014116)
 * You’ll want to use the loop for accessing the product options. You can exclude
   specific options by doing the following:
 *     ```
       foreach($product['options'] as $option) {
         $exclude = array( 'Item 1', 'Item 2', Item 3' ); /* change this to what you want excluded */
   
         if( in_array( $option['option_name'], $exclude ) ) {
             continue; /* skip over option */
         }
       ```
   

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Multilines’ is closed to new replies.

 * ![](https://ps.w.org/gravity-forms-pdf-extended/assets/icon-256x256.png?rev=3168987)
 * [Gravity PDF](https://wordpress.org/plugins/gravity-forms-pdf-extended/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gravity-forms-pdf-extended/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gravity-forms-pdf-extended/)
 * [Active Topics](https://wordpress.org/support/plugin/gravity-forms-pdf-extended/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gravity-forms-pdf-extended/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gravity-forms-pdf-extended/reviews/)

## Tags

 * [multiline](https://wordpress.org/support/topic-tag/multiline/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * 4 replies
 * 2 participants
 * Last reply from: [Jake Jackson](https://wordpress.org/support/users/blue-liquid-designs/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/multilines/#post-7014116)
 * Status: not resolved