Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • I suppose you’re right Ismael. :) For what it’s worth i’m a demanding son of a gun who tries everything. With that said i’m still really impressed with what enfold can do right out of the box, even if i feel a bit hindered at times. Still, it beats building all this from scratch.

    Thanks for the input. Be well!

    Well, my problem was exactly the same as the poster in the thread i linked to. You can have a look at the screenshot he attached with red text annotated over the “heading text” from the “special heading”. That’s exactly my problem. i.e when i try to save a shortcode (say [fetch_title]) in that text box (heading text) it doesn’t stick, so i’m guessing enfold filters it out before committing to database. it’s my own shortcode (added to functions.php) and it works nicely in say the default editor so i know there’s nothing wrong with it.
    Ergo my asking about how you actually know which (enfold) components support short codes (by support i mean i can write my short code in a field and it expands to something). It would help if there were some documentation so it was less of a guessing game. :)

    in reply to: Always open Advanced Layout Builder #742844

    Very kind of you to chime in Nikko! I’m afraid $(document).ready() is too early since (for me anyway) repeatedly fails to load the ALB.
    I did solve my particular issue with a slight modification though:

    // make avia default on new posts
    // use #postdivrich_wrap for editor only, #post-body for (pretty much) everything
    // see https://kriesi.at/support/topic/always-open-advanced-layout-builder/#post-452117
    add_action('admin_head-post-new.php', 'trigger_alb_on_load');
    function trigger_alb_on_load(){
    	echo '<style>#post-body { display: none; }</style>';
    	?>
    	<script>		
    		(function($){
    			$(window).load(function() {
    				$("#avia-builder-button").trigger('click');
    				$("#post-body").css('display', 'inherit');
    			});
    		})(jQuery);
    	</script>
    	<?php
    }

    This seems to work nicely. For me anyway.

    So i have this nasty habit of answering my own questions (hint hint). Anyway, i tried to figure out how write an action or a filter that somehow beats the admin (new post) page into submission, but time is precious and i quickly realized i’ll never get there fast enough. So i did the next best thing. I hacked the hack (aka this method gets rid of the “flicker” issue).

    // use #postdivrich_wrap for editor only, #post-body for (pretty much) everything
    // see https://kriesi.at/support/topic/always-open-advanced-layout-builder/#post-452117
    add_action('admin_head-post-new.php', 'trigger_alb_on_load');
    function trigger_alb_on_load(){
    	echo '<style>#postdivrich_wrap { display: none; }</style>';
    	?>
    	<script>		
    		(function($){
    			$(window).load(function() {
    				$("#avia-builder-button").trigger('click');
    				$("##postdivrich_wrap").css('display', 'inherit');
    			});
    		})(jQuery);
    	</script>
    	<?php
    }

    If you would like to go further than this, check out generic-helper.class.php and more specifically builder_status(). Also, template-builder.class.php and more specifically wrap_default_editor(). I gave up right about there on trying to find out what happens behind the curtains.

    • This reply was modified 7 years, 10 months ago by terminus112.
    in reply to: Always open Advanced Layout Builder #740973

    Is there by any chance any other way of accomplishing this? It does work, but it kind of loads the default editor then loads the avia ALB causing a noticeable flicker. IMHO it looks a bit unprofessional.

Viewing 5 posts - 1 through 5 (of 5 total)