Tagged: 

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #713649

    Hi Enfold team

    I’m talking about that: http://kriesi.at/documentation/enfold/add-new-or-replace-advanced-layout-builder-elements-from-child-theme/

    You said: “You can also add new ones using the other shortcode elements as examples.
    > I do not understand that (I’m not enlgish)

    I have override one of you AVIA element: postslider.php (My postslider.php is in my /shorcodes child theme folder and it works BUT it also override the original one, so : how can I create a new shortcode based on postslider.php that will not override the one of enfold ?)

    PS: before submitting a ticket here I have tried a lot of thing within this file, like, renaming the file to my-postslider.php and do some modifications in the file like this:

    if ( !class_exists( 'my_avia_sc_postslider' ))
    {
    	class my_avia_sc_postslider extends aviaShortcodeTemplate
    	{
    
    		/**
    		 * Create the config array for the shortcode button
    		 */
    		function shortcode_insert_button()
    		{
    			$this->config['name']		= __('Post Slider', 'avia_framework' );
    			$this->config['tab']		= __('Content Elements', 'avia_framework' );
    			$this->config['icon']		= AviaBuilder::$path['imagesURL']."sc-postslider.png";
    			$this->config['order']		= 30;
    			$this->config['target']		= 'avia-target-insert';
    			$this->config['shortcode'] 	= 'my_av_postslider';
    			$this->config['tooltip'] 	= __('Display MY Slideshow of Post Entries', 'avia_framework' );
    			$this->config['drag-level'] = 3;
    		}
    

    thanks

    #714778

    Hey pako69,

    Do you have this code in your child theme’s function.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;
    }

    If you already have it, you just need to create a folder named shortcodes in your child theme then paste in your my-postslider.php. Hope this helps.

    Best regards,
    Nikko

    • This reply was modified 8 years ago by Nikko.
    #714784

    Hi @Nikko
    Yes I have it since a long time and yes I also have a file called my-postslider.php in my child them /shortcodes/ folder (read my question: I have said that)
    My own shortcode (my-postslider.php) works but IT OVERRIDE the one from Enfold: I would like to use both of thoses shordcode :
    – My own
    – The one that come from Enfold

    #714790

    Hey!

    Can you give us temporary admin access? so we can inspect it further.

    Cheers!
    Nikko

    #714825

    Yes maybe on a developpement server, not the production server and only if french language don’t afraid you :)

    #714831

    Hi!

    Yes, that should be good atleast we can inspect and check if there’s missing why it’s not appearing.

    Regards,
    Nikko

    #714833

    I have never said that my own shortcode do not show up! It does… I said: “it works”…
    Do you understand what is my problem or maybe my english is not enough good?

    #714841

    Hey!

    Sorry if I misunderstood the question, I probably forgot some of the details when I saw your code above which uses same name Post Slider. Just to confirm I understood the issue properly, you have 2 post sliders, one comes with enfold and the other one (my-postslider) is modified by you, the modified version works fine but the when trying to use the original version the modified version is what is executed (since the modified version overrides the original), is this right?

    Can you try to post your whole code for my-postslider.php in http://pastebin.com/index.php and give us a link to it. So we atleast check the code. I might be able to reply on this tomorrow since it’s a bit late now.

    Regards,
    Nikko

    #714929
    #715167

    Hey!

    I have modified your code and it should be working properly and not overriding the one that comes from enfold: http://pastebin.com/JAQ6187v

    Here are the changes I made, in line 245 this code:
    ), $atts, 'av_postslider');
    I have changed av_postslider to my_av_postslider and all instances of avia_post_slider (total of 6) I have replaced with my_avia_post_slider. Let us know if it works properly on your end.

    Cheers!
    Nikko

    • This reply was modified 8 years ago by Nikko.
    #715181

    @Nikko > your are my hero! Now it works.
    joking aside, I think it will be great to explain how to do that there: http://kriesi.at/documentation/enfold/add-new-or-replace-advanced-layout-builder-elements-from-child-theme/
    Thanks a lot

    #715186

    Hi!

    Glad we could help :) Regarding the documentation, I think it’s a related topic but it’s a bit situational, it’s better to keep it simple. :)

    Cheers!
    Nikko

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Add new or replace Advanced Layout Builder elements from Child Theme?’ is closed to new replies.