Display Suite Custom Template Issues I've been using Display Suite for Drupal 7 (with Bamboo theme,) and I'm trying to build a layout template that contains 5 rows, so I can place the appropriate fields into each row, making all content nice and tidy. 

I've followed the instructions here, but I'm doing something wrong: https://www.drupal.org/node/1098068

I'm guessing it has to do with the PHP code, because I'm getting errors involving my wrappers. Here is the PHP code for the tpl.php file:

&lt;?php

/**
 * @file
 * Display Suite Bamboo custom template.
 */
?&gt;
&lt;&lt;?php print $layout_wrapper; print $layout_attributes; ?&gt; class="ds-bamboo &lt;?php print $classes;?&gt; clearfix"&gt;

  &lt;?php if (isset($title_suffix['contextual_links'])): ?&gt;
  &lt;?php print render($title_suffix['contextual_links']); ?&gt;
  &lt;?php endif; ?&gt;

  &lt;&lt;?php print $first_wrapper ?&gt; class="introduction&lt;?php print $first_classes; ?&gt;"&gt;
    &lt;?php print $first; ?&gt;
  &lt;/&lt;?php print $first_wrapper ?&gt;&gt;

  &lt;&lt;?php print $second_wrapper ?&gt; class="entry1-group&lt;?php print $second_classes; ?&gt;"&gt;
    &lt;?php print $second; ?&gt;
  &lt;/&lt;?php print $second_wrapper ?&gt;&gt;

  &lt;&lt;?php print $third_wrapper ?&gt; class="entry2-group&lt;?php print $third_classes; ?&gt;"&gt;
    &lt;?php print $third; ?&gt;
  &lt;/&lt;?php print $third_wrapper ?&gt;&gt;

&lt;&lt;?php print $fourth_wrapper ?&gt; class="entry3-group&lt;?php print $third_classes; ?&gt;"&gt;
    &lt;?php print $fourth; ?&gt;
  &lt;/&lt;?php print $fourth_wrapper ?&gt;&gt;

  &lt;&lt;?php print $footer_wrapper ?&gt; class="group-footer&lt;?php print $footer_classes; ?&gt;"&gt;
    &lt;?php print $footer; ?&gt;
  &lt;/&lt;?php print $footer_wrapper ?&gt;&gt;

&lt;/&lt;?php print $layout_wrapper ?&gt;&gt;

&lt;?php if (!empty($drupal_render_children)): ?&gt;
  &lt;?php print $drupal_render_children ?&gt;
&lt;?php endif; ?&gt;


I think it is very possible I am also writing my .inc file incorrectly. Here is that code as well: 

&lt;?php
function ds_ds_bamboo () {
  return array(
    'label' =&gt; t('Bamboo DS'),
    'regions' =&gt; array(

        'introduction' =&gt; t('Introduction'),
    'entry1-group' =&gt; t('Entry 1'),
    'entry2-group' =&gt; t('Entry 2'),
    'entry3-group' =&gt; t('Entry 3'),
    'group-footer' =&gt; t('Footer'),
          ),
    // Add this line if there is a default css file.
    'css' =&gt; TRUE,
      );
}


I would be very appreciative if someone can set me in the right direction. Thank you!
I have managed to solve this problem, and I'm posting my own answer here in hopes that it will help someone else struggling with this. 

First, when creating a Display Suite Custom Layout, follow the directions here: [https://www.drupal.org/node/1098068][1]

Then, if you are defining custom regions like I am, the trick is to create custom regions in your Drupal theme. To do this, go to sites/all/themes and enter the folder containing your theme. Then find your theme's .info file. 

This should be where the regions in your theme are stored and created. To set up the regions that will work with the php code listed above, enter: 

your_region_name = [name_of_custom_region] 

I created 7 regions this way. For example, my first region is named: 

introduction = [introduction]

This may be slightly different given how your theme is set to define regions, but this is what worked for me. I entered my new regions after the pre-existing Content region defined in the theme. (I have no idea if that makes a difference, but that is what worked for me.)

After you have defined the regions, insert and alter the php code from the question above in your Display Suite tpl.php file. (The link in the first step shows you how to define this file.)

You will then change some of the php code to reflect your custom regions. For example, if you defined your first region as "introduction" the code should look like this: 

    &lt;&lt;?php print $introduction_wrapper ?&gt; class="introduction&lt;?php print $introduction_classes; ?&gt;"&gt;
    &lt;?php print $introduction; ?&gt;
  &lt;/&lt;?php print $introduction_wrapper ?&gt;&gt;


You will then need to alter the code each time, entering the next region name that you defined in the .info file in order. 

Lastly, you will need to update your Display Suite custom layout .inc file. 
I did this by defining each newly created custom region that I wanted to show up on the custom layout within Drupal. As an example, my code looked like this in the end: 

    &lt;?php
function ds_ds_bamboo () {
  return array(
    'label' =&gt; t('Bamboo DS'),
    'regions' =&gt; array(

    'articletitle' =&gt; t('Article Title'),
        'titleimage' =&gt; t('Title Image'),
    'introduction' =&gt; t('Introduction'),
    'entry1' =&gt; t('Entry 1'),
    'entry2' =&gt; t('Entry 2'),
    'entry3' =&gt; t('Entry 3'),
    'author' =&gt; t('Author Bio'),
          ),
    // Add this line if there is a default css file.
    'css' =&gt; TRUE,
      );
}


Doing this will create row-like regions that will allow you to neatly group Drupal fields together, giving you a template for future content. 

As an example, my "entry1" region contains an image field, text field, another optional image field and text field, as well as a video embed field. Due to the structure of the code and Display Suite's field management, all of the fields and their content are kept nice and tidy within the custom region. 

I hope this helps if you're struggling with defining custom layouts in Display Suite!