Forum Replies Created
-
AuthorPosts
-
February 11, 2017 at 12:07 am in reply to: Shortcode in special heading (or other components/fields for that matter) #745657
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!
February 6, 2017 at 8:34 am in reply to: Shortcode in special heading (or other components/fields for that matter) #743200Well, 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. :)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.
February 2, 2017 at 2:33 am in reply to: Have the avia layout builder be the default editor for new posts/pages #741519So 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, 9 months ago by terminus112.
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.
-
AuthorPosts