Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #950343

    I have a layerslider on my start-page. After update to Enfold 4.3.1 just now the layerslider does not show. Instead it shows the text:

    [layerslider id=“1″]

    as a text instead of substituting the shortcode to a slide.
    Even deleting and re-creating it does not change the behaviour. I add a text-block, then click add-layerslider button and i can choose the slide, but still only the shortcode shows.

    Please help!

    Best regards,
    Torsten

    #950358

    Same issue here.

    On some pages not even the normal “advanced Layerslider” from Visual Element is working.
    Shortcode is not working at all since last 2 updates. Very frustrating. a lot of people complaining.

    When can we hope on a fix?

    #950406

    Same issue here. What gives? We need a fix fast!

    #950572

    Me too, same problem :(

    #950858

    This is an issue on our site as well. Please provide a fix asap.

    #950920

    Same problem. Solved it by adding LayerSlider element in Avia Layout Builder. The shortcode no longer works in 4.3.1.

    #950922

    It can be solved that way on most of the sites, but others not. I do have at least 3 pages where its not working when I add it via the builder.

    #950986

    It seems that you can not put the Advanced LayerSlider into a frame. It has to sit, full width, by itself. Or at least that’s what I’m finding. I have layer sliders that are ⅔ or ½ width. HOW DO I GET THEM TO WORK WITHOUT THE SHORTCODE?????

    #951008

    I have the same problem.

    A solution would be to create a “blank” and small empty slider in layerslider, and then add it to your page using ALB Layerslider element (and maybe make it disappear with CSS with display: none; ).
    Then, all shortcodes from layerslider on this page will work again

    But this is no permanent solution..

    #951033

    That is a brilliant idea, Vrout, as a workaround.

    #951053

    Vrout, thanks for the idea. What would the CSS be, exactly, to affect one blank layerslider on a specific page?

    #951060

    I took Vrout’s advice and put a 1px tall blank LayerSlider at the bottom of the page. Now the ⅔ size LayerSlider at the top of the page works, using the shortcode. An easy fix, but I’d still love to hear from Kriesi about a permanent fix.

    #951078

    Hi,

    I used this CSS code :

    .page-id-138 #layer_slider_1 {
    display: none !important; }

    138 being your page ID, and 1 your layerslider ID

    Glad to see it helped you

    #951392

    I did an new Visual Element.

    add following codes in your child theme:

    functions.php

    add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1);
    function avia_include_shortcode_template($paths)
    {
    	$template_url = get_stylesheet_directory();
    	array_unshift($paths, $template_url.'/shortcodes/');
    	return $paths;
    }

    ad shortcodes/slideshow_layerslider.php in your childtheme:

    <?php
    /**
     * Advanced Layerslider
     * 
     * Display a Layerslider Slideshow
     * @modified 4.2.1, 4.2.7
     * @modified_by Günter
     */
    if ( ! defined( 'ABSPATH' ) ) {  exit;  }    // Exit if accessed directly
    
    if( ! Avia_Config_LayerSlider()->is_active() )
    {
    	return;
    }
    
    if ( ! class_exists( 'avia_sc_layersliderB' ) ) 
    {
    	class avia_sc_layersliderB extends aviaShortcodeTemplate
    	{		
    			static $slide_count = 0;
    			
    			/**
    			 * Create the config array for the shortcode button
    			 */
    			public function shortcode_insert_button()
    			{
    				$this->config['self_closing']			=	'yes';
    				$class->config['forced_load_objects']	=	array( 'layerslider' );		//	fallback only to make sure we load in case user overwrites this class and direct checks for shortcode might fail
    				
    				$this->config['name']		= __('Modified Layerslider', 'avia_framework' );
    				$this->config['tab']		= __('Media Elements', 'avia_framework' );
    				$this->config['icon']		= AviaBuilder::$path['imagesURL']."sc-slideshow-layer.png";
    				$this->config['order']		= 10;
    				$this->config['target']		= 'avia-target-insert';
    				$this->config['shortcode'] 	= 'av_layerslider';
    				$this->config['tooltip'] 	= __('Display a Layerslider Slideshow', 'avia_framework' );
    				$this->config['tinyMCE'] 	= array('disable' => "true");
    				//$this->config['drag-level'] = 1;
    			}
    			
    			function extra_assets()
    			{
    				//load css
    				wp_enqueue_style( 'avia-module-slideshow-ls' , AviaBuilder::$path['pluginUrlRoot'].'avia-shortcodes/slideshow_layerslider/slideshow_layerslider.css' , array('avia-layout'), false );
    				
    					//load js
    				wp_enqueue_script( 'avia-module-slideshow-ls' , AviaBuilder::$path['pluginUrlRoot'].'avia-shortcodes/slideshow_layerslider/slideshow_layerslider.js' , array('avia-shortcodes'), false, TRUE );
    
    			}
    			
    			/**
    			 * 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.
    			 */
    			public function editor_element($params)
    			{	
    				//fetch all registered slides and save them to the slides array
    				$slides = Avia_Config_LayerSlider()->find_layersliders( true );
    				if(empty($params['args']['id']) && is_array($slides)) $params['args']['id'] = reset($slides);				
    				if(empty($params['args']['id'])) $params['args']['id'] = "";				
    				
    				$element = array(
    					'subtype' => $slides, 
    					'type'=>'select', 
    					'std' => $params['args']['id'], 
    					'class' => 'avia-recalc-shortcode',
    					'data'	=> array('attr'=>'id')
    				);
    				
    				$inner		 = "<img src='".$this->config['icon']."' title='".$this->config['name']."' />";
    				
    				
    				if(empty($slides))
    				{
    					$inner.= "<div><a target='_blank' href='".admin_url( 'admin.php?page=layerslider' )."'>".__('No Layer Slider Found. Click here to create one','avia_framework' )."</a></div>";
    				}
    				else
    				{
    					$inner .= "<div class='avia-element-label'>".$this->config['name']."</div>";
    					$inner .= AviaHtmlHelper::render_element($element);
    					$inner .= "<a target='_blank' href='".admin_url( 'admin.php?page=layerslider' )."'>".__('Edit Layer Slider here','avia_framework' )."</a>";
    				}
    				
    				$params['class'] = "av_sidebar";
    				$params['innerHtml'] = $inner;
    				
    				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
    			 * @param array $meta
    			 * @return string $output returns the modified html string 
    			 */
    			public function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = array() )
    			{
    				 $atts = shortcode_atts( array(
    												'id'	=>	0
    											), $atts, $this->config['shortcode'] );
    				
    				$output  = "";
    				
    				avia_sc_layersliderB::$slide_count++;
    				
    				$skipSecond = false;
    				$params = array();
    
    				/**
    				 * Get selected slider or last slider
    				 */
    				$slider = Avia_Config_LayerSlider()->get_default_slider( $atts['id'] );
    				
    				if( ! empty( $slider ) )
    				{		
    					$atts['id'] = $slider['id'];
    					$slides = json_decode( $slider['data'], true );	
    					$height = $slides['properties']['height'];	
    					$width  = $slides['properties']['width'];	
    					$responsive = ! empty( $slides['properties']['responsive'] ) ? $slides['properties']['responsive'] : '';
    					$responsiveunder = ! empty( $slides['properties']['responsiveunder'] ) ? $slides['properties']['responsiveunder'] : '';
    
    					$params['style'] = " style='height: ".($height+1)."px;' ";
    				}
    				else
    				{
    					/**
    					 * Force an error message in frontend for admins
    					 */
    					$atts['id'] = 0;
    				}
    				
    				
    				$params['class'] = "avia-layerslider main_color avia-shadow ".$meta['el_class'];
    				$params['open_structure'] = false;
    				
    				//we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
    				if(empty($meta['index'])) $params['close'] = false;
    				if(!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section )) $params['close'] = false;
    				
    				if(!empty($meta['index'])) $params['class'] .= " slider-not-first";
    				$params['id'] = "layer_slider_".( avia_sc_layersliderB::$slide_count );
    				
    				
    				$output .=  avia_new_section($params);
    				
    				if(class_exists('LS_Shortcode') && method_exists('LS_Shortcode', 'handleShortcode')) //fix for search results page - only works with latest LayerSlider versions
    				{
    					$output .= LS_Shortcode::handleShortcode( $atts );
    				}
    				else if(function_exists('layerslider_init')) //fix for search results page - only works with older LayerSlider versions
    				{
    					$output .= layerslider_init( $atts );
    				}
    				
    				$output .= "</div>"; //close section
    				
    				
    				//if the next tag is a section dont create a new section from this shortcode
    				if(!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el ))
    				{
    				    $skipSecond = true;
    				}
    
    				//if there is no next element dont create a new section.
    				if(empty($meta['siblings']['next']['tag']))
    				{
    				    $skipSecond = true;
    				}
    				
    				if(empty($skipSecond)) {
    				
    				$output .= avia_new_section(array('close'=>false, 'id' => "after_layer_slider_".avia_sc_layersliderB::$slide_count));
    				
    				}
    				
    				return $output = preg_replace("#</div>.*?</div>.*?</main>.*?</div>.*?</div>#","",$output);
    			}
    			
    	}
    }

    Then you will have a Modified Layerslider. You can use this code in any playcement, like 2/3 or 1/3 rows. And its working too. But this is also a very unnice solution to update it everywhere as the main slider shortcode not working anymore. Somewhere is a “if used load the js for the slider” and it doesn’t recognise the shortcode as a slider.
    I cant find that stuff yet.

    Would be awesome if Kiersi would beta test such stuff and not releasing such a big update, without any good support. Is somebody alive in this board except customer complaining?

    PS: I don’t know if it is working with all LAyout possibilities. PErhaps the avia_new_section function dioes the closing of all section which needts to be removed, instead of my replace… But your feedback will show me if its working everywhere or not.

    • This reply was modified 6 years, 6 months ago by BlutVampir.
    #952187

    Hi,

    @BlutVampir

    Thanks for your effort, but this doesn’t work for my test environment. (windows localhost)
    But it may work for some as a good option while waiting for the official fix.
    The adding a layerslider and hiding it with “display:none: does work for me though, which is another option.

    Best regards,
    Mike

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.