Home>Support>Adding class on a custom prebuilt layout

Adding class on a custom prebuilt layout

By Orfeo, 22 days ago. Last reply by Alex S, 17 days ago.

Hello,

I wan’t to create some prebuilt layouts for a website, it works well but I don’t know how to add a class to the row I created, here is my code :

      $layouts['cta-green'] = array(
          'name' => __('Call To Action - Green'),
          'description' => __('Green - Call to action' ),
          'screenshot' => get_template_directory_uri(). '/assets/images/layout-cta-green.png',
          'widgets' 		=> array(
                          0 => array(
                            'headline'  => array(
                              'text' 			=> "Image",
                              'tag'  			=> 'p',
                              'font_size'  	=> '28',
                              'color'  		=> '#ffffff',
                            ),
                            'divider' 	=> array(
                              'style'  		=> 'none',
                            ),
                            'info' 			=> array(
                                        'class' => 'SiteOrigin_Widget_Image_Widget',
                                        'id' 	=> '1',
                                        'grid' 	=> '0',
                                        'cell' 	=> '0',
                                      ),
                          ),
                          1 => array(
                          'title' 		=> "Text zone",
                          'text' 			=> '<h2>Call to action title</h2>
                          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
                          <a href="#" class="btn">Lorem ipsum</a>',
                          'filter' 		=> false,
                          'info' 			=> array(
                                          'class' => 'SiteOrigin_Widget_Editor_Widget',
                                          'id' 	=> '2',
                                          'grid' 	=> '0',
                                          'cell' 	=> '1',
                                        ),
                          ),
                        ),
                        'grids' 		=> array(
                              0 => array(
                              'cells' => '2',
                              <strong>'class' => 'push-green',</strong> //doesn't work !!!
                              'style' => array(
                                  'background'=>'#1BB58C',
                                ),
                              ),
                        ),
                        'grid_cells' 	=> array(
                                      0 => array(
                                      'weight' 	=> '0.5',
                                      'grid' 		=> '0',
                                      'style' => array(
                                            'vertical_alignment' => 'center',
                                            'padding' => '0'
                                          ),
                                      ),
                                      1 => array(
                                        'weight' 	=> '0.5',
                                        'grid' 		=> '0',
                                        'style' => array(
                                            'vertical_alignment' => 'center',
                                            'padding' => '30px'
                                          ),
                                        ),
                                      ),
                        );

How can I do that ?

Thanks a lot

This is a free community support forum. Replies are not guaranteed. If you need professional email support, please purchase a SiteOrigin Premium license.

  1. 21 days, 22 hours ago Orfeo

    I have found how to do that :

    'grids' 		=> array(
                                  0 => array(
                                  'cells' => '2',
                                  'style' => array(
                                      'class' => 'cta-green'
                                    ),
                                  ),
                            ),

    Is there a documentation somewhere about this ?

  2. 17 days, 6 hours ago Alex S Hi, I Work Here

    Hi Orfeo,

    I’m glad you were able to work out how to do this. I’m sorry I wasn’t able to be of assistance this time.

    Is there a documentation somewhere about this ?

    No. It’s recommended that you build the page and then export the page (click the Layout button, click Import/Export and export the layout). Then simply used the exported layout data as your base. This will prevent the need from having to do everything manually (which isn’t something we would recommend).

Please log in to post on our forums. Signing up is free.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More