-
AuthorPosts
-
February 1, 2017 at 2:33 pm #741243
Hey guys. How would one go about setting the advanced layout builder as the default editor for new posts/pages? Cant believe this isn’t already the default to be honest.
Anyway, i have a couple of ideas, but i’m kind of new to both enfold and wordpress so it’s hard for me to know where to look. The last enfold filter i wrote took me three days just because i didn’t know where to start.
One suggestion is activating the button using javascript once the page is loaded as suggested here: https://kriesi.at/support/topic/always-open-advanced-layout-builder/
The thing is it’s a bit hackish as it reloads the editor quite visibly in front of the user causing a “flicker”. I suppose it should be possible to hide the container until one activates the builder-button (all using javascript as suggested in that post). Still, it’s a bit too hackish for my taste.But it’s enfold that renders that builder-button in the first place and hence there has to be some mechanism that could activate the ALB before the admin panel (or editor content box) is rendered. In fact it does with posts/pages that has been previously edited with the ALB so could anyone point me in the right direction for where i would need to look to do this modification to allow for NEW posts and pages to edited straight away with the ALB too?
February 2, 2017 at 2:33 am #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, 10 months ago by terminus112.
February 6, 2017 at 7:47 pm #743542Hi,
thanks for sharing. 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 its really important for you to get this done, you can always hire a freelancer to do the job for you :)
Best regards,
AndyJanuary 18, 2018 at 4:32 pm #899194Late reply but here’s the solution: https://kriesi.at/support/topic/always-open-advanced-layout-builder/
January 19, 2018 at 12:59 pm #899650 -
AuthorPosts
- You must be logged in to reply to this topic.