• Resolved davidj0n

    (@davidj0n)


    Hi Guys,

    Based on your documentation, I’m trying to create some extra page elements, one of ’em is based on a Parent and Child element, everything is saving and displaying correclty in the frontend, but in the backend the titles of the child items don’t seem to change, they stay on their original value. The weird thing though is that whenever I click to the Shortcode tab, the content there shows correctly. I compared your builtin elements with my code and I can’t see anything wrong. And the builtin elements work perfeclty.

    What am I doing wrong? Is it perhaps a bug?

    The custom Parent class

    class IG_funfacts extends IG_Pb_Shortcode_Parent {
    
    	 public function __construct() {
    		parent::__construct();
    	}
    /**
    	  * Configure the custom page element
    	  **/
    	 public function element_config() {
    		 $this->config['shortcode']		=	strtolower(__CLASS__);
    		 $this->config['name']			= __('Fun Facts', IGPBL );
    		 $this->config['has_subshortcode'] = 'IG_Item_' . str_replace( 'IG_', '', __CLASS__ );
    
    		$this->config['edit_using_ajax'] = false;
    	 }
    	/**
    	  * Create all the custom fields and inputs for the custom page element.
    	  **/
    	 public function element_items() {
    
    			$this->items = array(
    
    				//Create fields shown in the Content tab. Use 'notab' to use a single tab.
    				'content' => array(
    
    					//create a textfield for the title
    					array(
    						'name' 	=> __('Title', IGPBL ),
    						'id' 	=> 'main_title',
    						'type'	=> 'text_field',
    						'role'	=> 'title',
    						'class' => 'jsn-input-xxlarge-fluid',
    						'std'	=> __('Hello World', IGPBL),
    						'tooltip' => __('Set the title of this element', IGPBL)
    					),
    					//subelement
    
    					array(
    						'id'            => 'funfacts_items',
    						'type'          => 'group',
    						'shortcode'     => ucfirst( __CLASS__ ),
    						'sub_item_type' => $this->config['has_subshortcode'],
    						'sub_items'     => array(
    							array( 'std' => '' ),
    							array( 'std' => '' ),
    						),
    
    					),
    					/**
    					 * Besides the tiny_mce and text_field you can choose from :
    					 * - button
    					 * - button_group
    					 * - checkbox
    					 * - color_picker
    					 * - dimension (w|h)
    					 * - gradient_picker
    					 * - group
    					 * - hidden
    					 * - hr
    					 * - icons
    					 * - items_list
    					 * - margin
    					 * - preview
    					 * - radio_button_group
    					 * - radio
    					 * - select_media
    					 * - select
    					 * - slider
    					 * - text_area
    					 * - text_number
    					 */ 
    
    				),
    
    				'styling' => array(
    
    					array(
    						'name'	=> __('Style', IGPBL),
    						'id'	=> 'style',
    						'type'	=> 'select',
    						'std'	=> 'alert-success',
    
    						'options' 	=> array(
    											'alert-danger' => __('Red'),
    											'alert-success' => __('green'),
    											'alert-warning' => __('Blue'),
    										),
    					),
    
    				)
    
    			);
    
    		}
    }

    The code for the child elements

    class IG_Item_funfacts extends IG_Pb_Shortcode_Child {
    
    		 public function __construct() {
    			 parent::__construct();
    		 }
    
    		 public function element_config() {
    			 $this->config['shortcode']		=	strtolower(__CLASS__);
    			 $this->config['exception'] = array(
    				'data-modal-title' => __( 'Funfact Item', IGPBL )
    			);
    		 }
    		 public function element_items() {
    
    			 $this->items = array(
    
    			 	'Notab' => array(
    			 		array(
    						'name' 	=> __('Title', IGPBL ),
    						'id' 	=> 'title',
    						'type'	=> 'text_field',
    						'role'	=> 'title',
    						'class' => 'jsn-input-xxlarge-fluid',
    						'std'   => __( IG_Pb_Utils_Placeholder::add_placeholder( 'Accordion Item %s', 'index' ), IGPBL ),
    						'tooltip' => __('Set the title of this element', IGPBL)
    					),
    					//create a WYSIWIG editor for content.
    					array(
    						'name' 	=> __('Content', IGPBL ),
    						'id' 	=> 'type',
    						'type'	=> 'text_field',
    						'class' => 'jsn-input-xx-large-fluid',
    						'tooltip' => __('Set the content of this element', IGPBL)
    					),
    			 	)
    
    			 );
    
    		 }
    }

    Can anybody help me?

    https://wordpress.org/plugins/ig-pagebuilder/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hi davidj0n,

    Thanks for the info, please stay tuned while I’m checking the problem for you.

    Hi,

    Sorry for my late reply. I tested your code in new version 2.3.0 but see that it works as normal. So please update your current IG Page Builder to 2.3.0 and try again.

    Thread Starter davidj0n

    (@davidj0n)

    hmm. i just updated the plugin. But I still get the problem. I tried turning on debugging, but it didnt give any warnings in my header. The lightbox however didn’t really work then anymore. And now I turned it off again and it still doesnt work, the modal iframe gets loaded with a blank screen and I get some errors in my console.

    `Uncaught InvalidAccessError: Failed to execute ‘setTimeout’ on ‘Window’: No script context is available in which to execute the script. handle_element.js?ver=1.0.0:848
    3
    Uncaught TypeError: undefined is not a function handle_element.js?ver=1.0.0:850′

    I’m scratching my head….

    Hi,

    Could you please provide your WordPress version ? In addition, if you could upload your custom plugin in any free online file sharing service and provide me with the link, it would help a lots.

    Thread Starter davidj0n

    (@davidj0n)

    Hi adam,

    Thanks for taking your time. I uploaded my custom addon here http://we.tl/VcBUssa5n9.

    I’m using WP 3.9.1, i already tried to deactivating all other plugins with no luck.

    In the file i also added some screenshots, which may be able to help you find out whats wrong.

    Again thank you.

    David.

    Hi,

    Thanks for the info, please stay tuned while I’m investigating the problem for you and I’ll reply back shortly.

    Hi davidj0n,

    I have checked your custom plugin but there are many PHP errors as you’re trying to mix code between sample Hello World plugin with Accordion. In this case, you can copy original file from Accordion (wp-content\plugins\ig-pagebuilder\shortcodes\accordion) then rename and add / remove functions from there instead.

    Plugin Author InnoGears

    (@innogears)

    Hi guys,

    There is a sample addon package here:

    http://www.innogears.com/docs/ig-pagebuilder/file/ig-helloworld.zip

    and the document for developers:

    http://www.innogears.com/docs/ig-pagebuilder/#!/dev

    so davidj0n can refer to it to build your custom addon. If you are building an element that has sub-elements inside, you can refer to the element “Helloworld2” in that package.

    Have a good development!

    Thread Starter davidj0n

    (@davidj0n)

    Great Adam,

    I’ve must have missed the sample addon package in the documentation, i tried creating it based on the documentation but the advanced section felt incomplete.

    However, yesterday I copied the accordion item and tried changing it, just got a bit lost in the code for the shortcode output, but looking at your sample pack, i’m sure I can figure it out.

    Thanks a lot for your time en effort.

    Hi,

    Thanks for your feedback, I reported this matter to development team to highlight this part in our documentation for better understanding.

    If you still have any question or need further assistant, don’t hesitate to let us know.

    Best regards,

    Adam.

    HI

    I am having issue in pagebuilder.. i added one module CALL TO ACTION.. i have one signup form created in INFUSIONSOFT..There are 2 pages in my HOME and BLOG.. on home page..i used pagebuilder call to action module where i pasted the form code in add media area…. it works properly… but when i added the same code in BLOG page … the call to action module does not support input tag… and form is not displayed…. can anybody help me out from this issue?

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Custom addon for child elements is not displaying correctly’ is closed to new replies.