syamilmj / aqua-page-builder

Aqua Page Builder WordPress Plugin
238 stars 113 forks source link

Default templates! #117

Closed WP-Panda closed 10 years ago

WP-Panda commented 10 years ago

Hello! I have used this function https://github.com/syamilmj/Aqua-Page-Builder/issues/26#issuecomment-13632924 , all works, but the order of widgets is not saved. I am trying to do it by means of array of such kind

$this->create_default_template(array('Home Page Template'=>array ( 
                    'aq_block_1' =>array ( 
                        'title' =>' dddddddddddddddddddddddddddd',
                        'text' => 'dddddddddd', 
                        'wp_autop' => 0, 
                        'id_base' => 'aq_text_block', 
                        'name' => 'Text',
                        'order' => 1, 
                        'size' => 'span6', 
                        'parent' => 0, 
                        'number' => 1, 
                    ) ,
                    'aq_block_2' => array ( 
                        'horizontal_line' => 'double', 'height' =>'',
                        'line_color' =>' #494949',
                        'id_base' => 'aq_clear_block',
                        'name' => 'Clear', 
                        'order' => 2, 
                        'size' => 'span12', 
                        'parent' => 0, 
                        'number' => 2, 
                    ) ,
                    'aq_block_3' => array ( 
                        'title' => 'xxxx',
                        'content' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxx',
                        'type' => 'warn',
                        'style' =>'',
                        'id_base' => 'aq_alert_block',
                        'name' => 'Alerts',
                        'order' => 3,
                        'size' => 'span6',
                        'parent' => 0,
                        'number' => 3,
                    ), 
                    'aq_block_4' => array ( 
                        'tabs' => array ( 
                            1 => array ( 'title' => 'My New Tab',
                                'content' => 'My tab contents',
                                )
                            ),
                        'type' => 'toggle', 
                        'id_base' => 'aq_tabs_block',
                        'name' => 'Tabs & Toggles', 
                        'order' => 4, 
                        'size' => 'span6', 
                        'parent' => 0,
                        'number' => 4,
                    )
                ) 
                )
                );

The template is built, but there is no contents. How to set correctly the template default settings?

hasanfazary commented 10 years ago

I don't fully remember every thing about that, but I think you just have to set the default values for the " block / moudle " you are inserting , in the class that create the block itself. and just call it only like ; $this->create_default_template(array('Home Page Template'=>array ( 'aq_text_block', 'aq_alert_block')));