Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #966617

    Hi
    i try to use my own shortcode by this example here.
    Now i try to add a list-feature, but this not work.
    My Code:

    <?php
    /**
     * Featurebox
     * 
     * Shortcode which creates a text element wrapped in a div
     */
    if ( ! defined( 'ABSPATH' ) ) {  exit;  }    // Exit if accessed directly
    
    if ( !class_exists( 'avia_sc_olicci_featurebox' ) )
    {
    	class avia_sc_olicci_featurebox extends aviaShortcodeTemplate
    	{
    			/**
    			 * Create the config array for the shortcode button
    			 */
    			function shortcode_insert_button()
    			{
    				$this->config['self_closing']	=	'no';
    				
    				$this->config['name']			= __('Feature Box', 'avia_framework' );
    				$this->config['tab']			= __('Content Elements', 'avia_framework' );
    				$this->config['icon']			= AviaBuilder::$path['imagesURL']."sc-contentslider.png";
    				$this->config['order']			= 1;
    				$this->config['target']			= 'avia-target-insert';
    				$this->config['shortcode'] 		= 'av_olicci_featurebox';
    				$this->config['shortcode_nested'] = array('av_olicci_featureitem');
    				$this->config['tooltip'] 	    = __('Create an olicci Feature Box Element', 'avia_framework' );
    				$this->config['preview'] 		= true;
    				$this->config['modal_data']		= array('modal_class' => 'mediumscreen');
    			}
    
    			/**
    			 * Popup Elements
    			 *
    			 * If this function is defined in a child class the element automatically gets an edit button, that, when pressed
    			 * opens a modal window that allows to edit the element properties
    			 *
    			 * @return void
    			 */
    			function popup_elements()
    			{
    				$this->elements = array(
    					
    					array(
    							"type" 	=> "tab_container", 'nodescription' => true
    						),
    						
    					array(
    							"type" 	=> "tab",
    							"name"  => __("Content" , 'avia_framework'),
    							'nodescription' => true
    						),
    					array(
    						"name" => __("Heading", 'avia_framework'),
    						'desc' => __('Trage hier die Headline ein','olicci'),
    						'id' => 'heading',
    						'type' => 'input',
    						'std' => 'Adserver'
    					),
    					array(
    						"name" => __("Subheading","avia_framework"),
    						"desc" => __("Add an extra descriptive subheading below the actual heading","avia_framework"),
    						"id" => "subheading",
    						"type" => "input",
    						"std" => ""
    					),
    					array(
    							"name" 	=> __("Content",'avia_framework' ),
    							"desc" 	=> __("Enter some content for this textblock",'avia_framework' ),
    							"id" 	=> "content",
    							"type" 	=> "textarea",
    							"std" 	=> __("Click here to add your own text", "avia_framework" )
    							),
    					array(	"name" 	=> __("Adserver Auswahl", 'olicci' ),
    							"desc" 	=> __("Trage hier die Adserver ein, in denen das Feature enthalten ist", 'olicci' ),
    				            "id" 	=> "adserver",
    				            "type" 	=> "modal_group",
    				            "modal_title" => __("Edit List Item", "avia_framework"),
    				            "std" => array(
    				            	array('title' => 'Display AdServer','color' => "#400954", "link" => "")
    				            ),
    				            "subelements" => array(
    				            	array(
    				            		"name" => "AdServer Titel",
    				            		"desc" => "Der Titel des AdServers",
    				            		"id" => "title",
    				            		"std" => "Adnetwork",
    				            		"type" => "input"
    				            	),
    				            	array(
    				            		"name" => "Link",
    				            		"desc" => "Link zur Adserver Beschreibung",
    				            		"id" => "link",
    				            		"type" => "linkpicker",
    				            		"fetchTMPL" => true,
    				            		"std" => "",
    				            		"subtype" => array(
    				            			__('No Link', 'avia_framework' ) =>'',
                                            __('Set Manually', 'avia_framework' ) =>'manually',
                                            __('Single Entry', 'avia_framework' ) =>'single',
                                            __('Taxonomy Overview Page',  'avia_framework' )=>'taxonomy',
    				            		)
    				            	),
    				            	array(
    				            		"name" => "Kreis-Farbe",
    				            		"desc" => "Farbe des Kreises des Elements",
    				            		"id" => "link_color",
    				            		"type" => "colorpicker",
    				            		"std" => "",
    				            	)
    				            )
    				        ),
    
    					array(
    							"type" 	=> "close_div",
    							'nodescription' => true
    						),
    					
    					array(
    							"type" 	=> "tab",
    							"name"	=> __("Screen Options",'avia_framework' ),
    							'nodescription' => true
    						),
    					
    							array(
    								"name" 	=> __("Element Visibility",'avia_framework' ),
    								"desc" 	=> __("Set the visibility for this element, based on the device screensize.", 'avia_framework' ),
    								"type" 	=> "heading",
    								"description_class" => "av-builder-note av-neutral",
    								),
    							
    							array(	
    									"desc" 	=> __("Hide on large screens (wider than 990px - eg: Desktop)", 'avia_framework'),
    									"id" 	=> "av-desktop-hide",
    									"std" 	=> "",
    									"container_class" => 'av-multi-checkbox',
    									"type" 	=> "checkbox"),
    							
    							array(	
    								
    									"desc" 	=> __("Hide on medium sized screens (between 768px and 989px - eg: Tablet Landscape)", 'avia_framework'),
    									"id" 	=> "av-medium-hide",
    									"std" 	=> "",
    									"container_class" => 'av-multi-checkbox',
    									"type" 	=> "checkbox"),
    									
    							array(	
    								
    									"desc" 	=> __("Hide on small screens (between 480px and 767px - eg: Tablet Portrait)", 'avia_framework'),
    									"id" 	=> "av-small-hide",
    									"std" 	=> "",
    									"container_class" => 'av-multi-checkbox',
    									"type" 	=> "checkbox"),
    									
    							array(	
    								
    									"desc" 	=> __("Hide on very small screens (smaller than 479px - eg: Smartphone Portrait)", 'avia_framework'),
    									"id" 	=> "av-mini-hide",
    									"std" 	=> "",
    									"container_class" => 'av-multi-checkbox',
    									"type" 	=> "checkbox"),
    							
    							
    							array(
    								"name" 	=> __("Font Size",'avia_framework' ),
    								"desc" 	=> __("Set the font size for the element content, based on the device screensize.", 'avia_framework' ),
    								"type" 	=> "heading",
    								"description_class" => "av-builder-note av-neutral",
    								),
    								
    							
    							
    								
    							array(	"name" 	=> __("Font Size for medium sized screens (between 768px and 989px - eg: Tablet Landscape)", 'avia_framework' ),
    				            "id" 	=> "av-medium-font-size",
    				            "type" 	=> "select",
    				            "subtype" => AviaHtmlHelper::number_array(10,60,1, array( __("Default", 'avia_framework' )=>''), "px"),
    				            "std" => ""),
    				            
    				            array(	"name" 	=> __("Font Size for small screens (between 480px and 767px - eg: Tablet Portrait)", 'avia_framework' ),
    				            "id" 	=> "av-small-font-size",
    				            "type" 	=> "select",
    				            "subtype" => AviaHtmlHelper::number_array(10,60,1, array( __("Default", 'avia_framework' )=>''), "px"),
    				            "std" => ""),
    				            
    							array(	"name" 	=> __("Font Size for very small screens (smaller than 479px - eg: Smartphone Portrait)", 'avia_framework' ),
    				            "id" 	=> "av-mini-font-size",
    				            "type" 	=> "select",
    				            "subtype" => AviaHtmlHelper::number_array(10,60,1, array( __("Default", 'avia_framework' )=>''), "px"),
    				            "std" => ""),
    					
    						
    					array(
    							"type" 	=> "close_div",
    							'nodescription' => true
    						),	
    					
    						
    					array(
    							"type" 	=> "close_div",
    							'nodescription' => true
    						),
    				);
    
    			}
    
    			/**
    			 * Editor Sub Element - this function defines the visual appearance of an element that is displayed within a modal window and on click opens its own modal window
    			 * Works in the same way as Editor Element
    			 * @param array $params this array holds the default values for $content and $args.
    			 * @return $params the return array usually holds an innerHtml key that holds item specific markup.
    			 */
    			function editor_sub_element($params)
    			{
    				$template = $this->update_template("title", __("Element", 'avia_framework' ). ": {{title}}");
    
    				//extract(av_backend_icon($params)); // creates $font and $display_char if the icon was passed as param "icon" and the font as "font"
    
    				$params['innerHtml']  = "";
    				$params['innerHtml'] .= "<div class='avia_title_container'>";
    				$params['innerHtml'] .= "<span>";//"<span ".$this->class_by_arguments('font' ,$font).">";
    				//$params['innerHtml'] .= "<span data-update_with='icon_fakeArg' class='avia_tab_icon'>".$display_char."</span>";
    				$params['innerHtml'] .= "</span>";
    				$params['innerHtml'] .= "<span {$template} >".__("Element", 'avia_framework' ).": ".$params['args']['title']."</span></div>";
    
    				return $params;
    			}
    
    			/**
    			 * Editor Element - this function defines the visual appearance of an element on the AviaBuilder Canvas
    			 * Most common usage is to define some markup in the $params['innerHtml'] which is then inserted into the drag and drop container
    			 * Less often used: $params['data'] to add data attributes, $params['class'] to modify the className
    			 *
    			 *
    			 * @param array $params this array holds the default values for $content and $args.
    			 * @return $params the return array usually holds an innerHtml key that holds item specific markup.
    			 */
    			function editor_element($params)
    			{
    				$params['class'] = "";
    				$params['innerHtml'] = "<div class='avia_featurebox avia_textblock_style' data-update_with='content'>".stripslashes(wpautop(trim(html_entity_decode( $params['content']) )))."</div>";
    				return $params;
    			}
    
    			/**
    			 * Frontend Shortcode Handler
    			 *
    			 * @param array $atts array of attributes
    			 * @param string $content text within enclosing form of shortcode element
    			 * @param string $shortcodename the shortcode found, when == callback name
    			 * @return string $output returns the modified html string
    			 */
    			function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
    			{
    				extract(AviaHelper::av_mobile_sizes($atts)); //return $av_font_classes, $av_title_font_classes and $av_display_classes 
    
    				extract(shortcode_atts(array(
    				'font_color' => "",
    				'color' => '',
    				'size' => '',
    				
    				), $atts, $this->config['shortcode']));
    				
    				
    				$custom_class = !empty($meta['custom_class']) ? $meta['custom_class'] : "";
                    $output = '';
                    $markup = avia_markup_helper(array('context' => 'entry','echo'=>false, 'custom_markup'=>$meta['custom_markup']));
                    $markup_text = avia_markup_helper(array('context' => 'entry_content','echo'=>false, 'custom_markup'=>$meta['custom_markup']));
    
    				$output .= "<!-- ";
    				$output .= var_export([$atts,$content],true);
    				$output .= "-->\n";
                    $output .= '<section class="av_featurebox_section">';// '.$markup.'>';
                    $output .= '<div class="olicci-sign">';
                    $output .= '<img src="'.trailingslashit(get_stylesheet_directory_uri()).'img/olicci-sign-30x30.png" alt="" />';
                    $output .= '</div>';
                    $output .= '<div class="title">';
                    $output .= "<h4>".$atts['heading']."</h4>";
                    $output .= "<h6>".$atts['subheading']."</h6>";
                    $output .= "</div>";
                    //$output .= "<div class='avia_textblock {$custom_class}' {$markup_text}>".ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content) )."</div>";
                    $output .= "<div class='avia_textblock {$custom_class}'>".ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content) )."</div>";
                    $output .= "<div class='avia_footer'>";
                    $output .= "</div>";
                    $output .= '</section>';
    
                    return $output;
    			}
    			function av_olicci_featureitem($atts, $content = "", $shortcodename = "")
    			{
    				
    				//extract($this->screen_options); //return $av_font_classes, $av_title_font_classes and $av_display_classes
    				
                    $atts =  shortcode_atts(array('title' => '', 'link' => '', 'link_color' => ''), $atts, 'av_olicci_featureitem');
    
                    $output = "";
                    $output = "<a href='".esc_url($atts['link'])."' class='tooltip' data-tooltip='".esc_attr($atts['title'])."'>";
                    $output .= "<div class='circle' style='background-color: ".esc_attr($atts['link_color'])."'></div>";
                    $output .= "</a>";
                    /*
    				$output  = "";
    				$output .= "<li>";
    				$output .= 		"<{$display_char_wrapper['start']} {$this->icon_html_styling} class='iconlist_icon  avia-font-".$atts['font']."'><span class='iconlist-char '></span></{$display_char_wrapper['end']}>";
                    $output .=          '<article class="article-icon-entry '.$contentClass.'" '.avia_markup_helper(array('context' => 'entry','echo'=>false, 'custom_markup'=>$atts['custom_markup'])).'>';
    				$output .=              "<div class='iconlist_content_wrap'>";
                    $output .=                  '<header class="entry-content-header">';
                    $markup = avia_markup_helper(array('context' => 'entry_title','echo'=>false, 'custom_markup'=>$atts['custom_markup']));
    				if(!empty($atts['title'])) $output .="<{$title_el} class='av_iconlist_title iconlist_title{$iconlist_title} {$this->title_class} {$av_title_font_classes}' {$markup} {$this->title_styling}>".$atts['title']."</{$title_el}>";
                    $output .=                  '</header>';
                    $markup = avia_markup_helper(array('context' => 'entry_content','echo'=>false, 'custom_markup'=>$atts['custom_markup']));
    				$output .=                  "<div class='iconlist_content {$this->content_class} {$av_font_classes}' {$markup} {$this->content_styling}>".ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop( $content ) )."</div>";
                    $output .=              "</div>";
                    $output .=              '<footer class="entry-footer"></footer>';
                    $output .=          '</article>';
    				$output .=      "<div class='iconlist-timeline'></div>";
    				$output .= "</li>";
                    */
    
    				return $output;
    			}
    
    	}
    }
    

    That outputted:

    <p>‚ av-medium-font-size=“ av-small-font-size=“ av-mini-font-size=“ av_uid=’av-3590‘ admin_preview_bg=“]<br>
    Affiliate AdServer ist mit einem innovativen Feature ausgestattet, durch das der Betreiber Aufgaben auf verschiedene Manager verteilen kann. Jeder Manager erhält einen eigenen Account, mit dem er verschiedene Inventare verwalten oder Aufgaben wie die Prüfung von Werbemitteln ausführen kann.</p>

    How i can add the list-feature to my element (every list-item needs a title, link and a color, not more)?

    Thanks,
    Stefan

    #967715

    Hey wpler,

    Thank you using Enfold.

    Have you tried using the icon list element? Instead of creating a new element, use the existing icon list then remove the icon manually with css.

    // https://kriesi.at/documentation/enfold/intro-to-advanced-layout-builder/#turn-on-custom-css-class-field-for-all-alb-elements

    You may need to enable the custom css class field to distinguish a specific icon element.

    Best regards,
    Ismael

    #968557

    Hello Ismael,
    no.. i would like create a own element. The element have a headline, sub-headline, text-content and in the footer should display a variation of given links to products. These product links (its a link, link-title and a color for the circle) i would realize with the list in the element. On edit mode all works fine, but the display are broken, like you see in the output what i have wrote before.
    I think is a failure in the output of the sub-element, but i don’t understand why btw. what i must change.
    Please look in my postet code, you can see what i have do.

    #970812

    Hi,

    Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)

    Best regards,
    Basilis

    #970818

    Sorry, I am developer byself!
    So you are not able to explain how the list element programmatically works in the Avia Framework? The Inline documentation says not clearly how it works and only that i know, that the sub-element prints out the code into the $content param I know not more. But this can not be all!
    It is possible to explain how the sub-element / list-element with their parameters what given in the sub-element item-array works and how i got this or not?

    #971165

    Hi wpler,

    I asked our dev to have a look at this thread, he’ll reply whenever he can.

    Best regards,
    Victoria

    #971185

    Hi,

    thanks Victoria (y)

    #971403

    Hey!
    I created a custom shortcode based on the toggles shortcode for you:

    
    <?php
    /**
     * Featurebox
     * 
     * Shortcode which creates a text element wrapped in a div
    */
    if ( ! defined( 'ABSPATH' ) ) {  exit;  }    // Exit if accessed directly
    
    if ( !class_exists( 'avia_sc_olicci_featurebox' ) )
    {
        class avia_sc_olicci_featurebox extends aviaShortcodeTemplate
        {
            static $toggle_id = 1;
            static $counter = 1;
            static $initial = 0;
            static $tags = array();
            static $atts = array();
    
            /**
             * Create the config array for the shortcode button
             */
            function shortcode_insert_button()
            {
    			$this->config['self_closing']	=	'no';
    			
                $this->config['name']           = __('Feature Box', 'avia_framework' );
                $this->config['tab']		= __('Content Elements', 'avia_framework' );
                $this->config['icon']		= AviaBuilder::$path['imagesURL']."sc-contentslider.png";
                $this->config['order']		= 70;
                $this->config['target']		= 'avia-target-insert';
                $this->config['shortcode'] 	= 'av_olicci_featurebox';
                $this->config['shortcode_nested'] = array('av_olicci_featureitem');
                $this->config['tooltip'] 	= __('Create an olicci Feature Box Element', 'avia_framework' );
                $this->config['disabling_allowed'] = true;
            }
    
    		function admin_assets()
    		{
    			$ver = AviaBuilder::VERSION;
                wp_enqueue_script('avia_tab_toggle_js' , AviaBuilder::$path['assetsURL'].'js/avia-tab-toggle.js' , array('avia_modal_js'), $ver, TRUE );
    		}
    			
            function extra_assets()
    			{
    				//load css
    				wp_enqueue_style( 'avia-module-toggles' , AviaBuilder::$path['pluginUrlRoot'].'avia-shortcodes/toggles/toggles.css' , array('avia-layout'), false );
    				
    					//load js
    				wp_enqueue_script( 'avia-module-toggles' , AviaBuilder::$path['pluginUrlRoot'].'avia-shortcodes/toggles/toggles.js' , array('avia-shortcodes'), false, TRUE );
    
    			}
            
    
            /**
             * Popup Elements
             *
             * If this function is defined in a child class the element automatically gets an edit button, that, when pressed
             * opens a modal window that allows to edit the element properties
             *
             * @return void
             */
            function popup_elements()
            {
                $this->elements = array(
    
                        array(
                                "type"  => "tab_container", 'nodescription' => true
                            ),
                            
                        array(
                                "type"  => "tab",
                                "name"  => __("Content" , 'avia_framework'),
                                'nodescription' => true
                            ),
                        array(
                            "name" => __("Heading", 'avia_framework'),
                            'desc' => __('Trage hier die Headline ein','olicci'),
                            'id' => 'heading',
                            'type' => 'input',
                            'std' => 'Adserver'
                        ),
                        array(
                            "name" => __("Subheading","avia_framework"),
                            "desc" => __("Add an extra descriptive subheading below the actual heading","avia_framework"),
                            "id" => "subheading",
                            "type" => "input",
                            "std" => ""
                        ),
                    array(
                        "name" => __("Adserver Auswahl", 'avia_framework' ),
                        "desc" => __("Trage hier die Adserver ein, in denen das Feature enthalten ist", 'avia_framework' ),
                        "type" 			=> "modal_group",
                        "id" 			=> "content",
                        "modal_title" 	=> __("Edit List Item", 'avia_framework' ),
                                "std" => array(
                                    array('title' => 'Display AdServer','color' => "#400954", "link" => "")
                                ),
    
                        'subelements' 	=> array(
    
                                    array(
                                        "name" => "AdServer Titel",
                                        "desc" => "Der Titel des AdServers",
                                        "id" => "title",
                                        "std" => "Adnetwork",
                                        "type" => "input"
                                    ),
                                    array(
                                        "name" => "Link",
                                        "desc" => "Link zur Adserver Beschreibung",
                                        "id" => "link",
                                        "type" => "linkpicker",
                                        "fetchTMPL" => true,
                                        "std" => "",
                                        "subtype" => array(
                                            __('No Link', 'avia_framework' ) =>'',
                                            __('Set Manually', 'avia_framework' ) =>'manually',
                                            __('Single Entry', 'avia_framework' ) =>'single',
                                            __('Taxonomy Overview Page',  'avia_framework' )=>'taxonomy',
                                        )
                                    ),
                                    array(
                                        "name" => "Kreis-Farbe",
                                        "desc" => "Farbe des Kreises des Elements",
                                        "id" => "link_color",
                                        "type" => "colorpicker",
                                        "std" => "",
                                    )
    
                        )
                    ),
    				
    				array(
    							"type" 	=> "close_div",
    							'nodescription' => true
    				),		
    						
    								array(
    									"type" 	=> "tab",
    									"name"	=> __("Screen Options",'avia_framework' ),
    									'nodescription' => true
    								),
    								
    								
    								array(
    								"name" 	=> __("Element Visibility",'avia_framework' ),
    								"desc" 	=> __("Set the visibility for this element, based on the device screensize.", 'avia_framework' ),
    								"type" 	=> "heading",
    								"description_class" => "av-builder-note av-neutral",
    								),
    							
    								array(	
    										"desc" 	=> __("Hide on large screens (wider than 990px - eg: Desktop)", 'avia_framework'),
    										"id" 	=> "av-desktop-hide",
    										"std" 	=> "",
    										"container_class" => 'av-multi-checkbox',
    										"type" 	=> "checkbox"),
    								
    								array(	
    									
    										"desc" 	=> __("Hide on medium sized screens (between 768px and 989px - eg: Tablet Landscape)", 'avia_framework'),
    										"id" 	=> "av-medium-hide",
    										"std" 	=> "",
    										"container_class" => 'av-multi-checkbox',
    										"type" 	=> "checkbox"),
    										
    								array(	
    									
    										"desc" 	=> __("Hide on small screens (between 480px and 767px - eg: Tablet Portrait)", 'avia_framework'),
    										"id" 	=> "av-small-hide",
    										"std" 	=> "",
    										"container_class" => 'av-multi-checkbox',
    										"type" 	=> "checkbox"),
    										
    								array(	
    									
    										"desc" 	=> __("Hide on very small screens (smaller than 479px - eg: Smartphone Portrait)", 'avia_framework'),
    										"id" 	=> "av-mini-hide",
    										"std" 	=> "",
    										"container_class" => 'av-multi-checkbox',
    										"type" 	=> "checkbox"),
    									
    								
    							  
    				
    							
    								
    							array(
    									"type" 	=> "close_div",
    									'nodescription' => true
    								),	
    								
    								
    						
    						
    					array(
    						"type" 	=> "close_div",
    						'nodescription' => true
    					),
    
                );
    
                if(current_theme_supports('avia_template_builder_custom_tab_toogle_id'))
                {
                    $this->elements[2]['subelements'][] = array(
                        "name" 	=> __("For Developers: Custom Toggle ID",'avia_framework' ),
                        "desc" 	=> __("Insert a custom ID for the element here. Make sure to only use allowed characters",'avia_framework' ),
                        "id" 	=> "custom_id",
                        "type" 	=> "input",
                        "std" 	=> "");
                }
    
            }
    
            /**
             * Editor Sub Element - this function defines the visual appearance of an element that is displayed within a modal window and on click opens its own modal window
             * Works in the same way as Editor Element
             * @param array $params this array holds the default values for $content and $args.
             * @return $params the return array usually holds an innerHtml key that holds item specific markup.
             */
            function editor_sub_element($params)
            {
                $template = $this->update_template("title", "{{title}}");
    
                $params['innerHtml']  = "";
                $params['innerHtml'] .= "<div class='avia_title_container' {$template}>".$params['args']['title']."</div>";
    
                return $params;
            }
    
            /**
             * Frontend Shortcode Handler
             *
             * @param array $atts array of attributes
             * @param string $content text within enclosing form of shortcode element
             * @param string $shortcodename the shortcode found, when == callback name
             * @return string $output returns the modified html string
             */
            function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
            {
                    extract(AviaHelper::av_mobile_sizes($atts)); //return $av_font_classes, $av_title_font_classes and $av_display_classes 
    
                    extract(shortcode_atts(array(
                    'font_color' => "",
                    'color' => '',
                    'size' => '',
                    
                    ), $atts, $this->config['shortcode']));
                    
                    
                    $custom_class = !empty($meta['custom_class']) ? $meta['custom_class'] : "";
                    $output = '';
                    $markup = avia_markup_helper(array('context' => 'entry','echo'=>false, 'custom_markup'=>$meta['custom_markup']));
                    $markup_text = avia_markup_helper(array('context' => 'entry_content','echo'=>false, 'custom_markup'=>$meta['custom_markup']));
    
                    $output .= "<!-- ";
                    $output .= var_export([$atts,$content],true);
                    $output .= "-->\n";
                    $output .= '<section class="av_featurebox_section">';// '.$markup.'>';
                    $output .= '<div class="olicci-sign">';
                    $output .= '<img src="'.trailingslashit(get_stylesheet_directory_uri()).'img/olicci-sign-30x30.png" alt="" />';
                    $output .= '</div>';
                    $output .= '<div class="title">';
                    $output .= "<h4>".$atts['heading']."</h4>";
                    $output .= "<h6>".$atts['subheading']."</h6>";
                    $output .= "</div>";
                    //$output .= "<div class='avia_textblock {$custom_class}' {$markup_text}>".ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content) )."</div>";
                    $output .= "<div class='avia_textblock {$custom_class}'>".ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content) )."</div>";
                    $output .= "<div class='avia_footer'>";
                    $output .= "</div>";
                    $output .= '</section>';
                    return $output;
            }
    
            function av_olicci_featureitem($atts, $content = "", $shortcodename = "")
            {
                $output = $titleClass = $contentClass = "";
                /*$toggle_atts = shortcode_atts(array('title' => '', 'tags' => '', 'custom_id' => '', 'custom_markup' =>''), $atts, 'av_olicci_featureitem');
    			$toggle_init_open_style = "";*/
                
                $atts =  shortcode_atts(array('title' => '', 'link' => '', 'link_color' => ''), $atts, 'av_olicci_featureitem');
    
                $link = aviaHelper::get_url($atts['link']);
    
                $output = "<a href='".$link."' class='tooltip' data-tooltip='".esc_attr($atts['title'])."'>";
                $output .= "<div class='circle' style='background-color: ".esc_attr($atts['link_color'])."'></div>";
                $output .= "</a>";
    			
    
                return $output;
            }
    
        }
    }
    
    

    You can use it as a starting point for additional shortcode settings, etc.

    Regards,
    Peter

    #971693

    Thanks, Peter…. this code works fine!

    #971703

    Hi,

    Great – glad we could help you!

    Best regards,
    Dude

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Avia Page Builder with own custom Shortcode’ is closed to new replies.