-
AuthorPosts
-
November 23, 2021 at 7:40 pm #1330181
Hi,
Hope you can help me with this. When I call for example:
https://domain.com/wp-admin/post.php?post=13841&action=edit&classic-editor=1
it opens in Classic Editor – Default Editor view.
To go the Enfold Advanced Layout Editor I need to click that button.Is there a way to open a certain page by ID in the Advanced Layout Editor directly (so without the intermediate step of clicking the button)?
Rob
Added remark:
Or is it really as simple as using 0 instead of 1?
https://domain.com/wp-admin/post.php?post=13841&action=edit&classic-editor=0
- This topic was modified 2 years, 12 months ago by rob2701. Reason: added remark
November 24, 2021 at 4:24 am #1330219Hi Rob,
The last query string is not required.
On my end, I only get this:https://domain.com/wp-admin/post.php?post=13841&action=edit
What version of Enfold and WordPress are you using?
Best regards,
NikkoNovember 24, 2021 at 8:36 am #1330262Hi Nikko,
WP 5.8.2 and Enfold 4.8.7.1. Yes that works, IF the ALE was active when you started that link.
But if before the default editor in text view was opened on an item, that is what will open with that link.
So I need to know the correct way to access the ALE programmatically for it to open straight in ALE only.Added clarification:
The access to ALE via link was just to illustrate the process, I would like to know if it’s possbile to open a page in ALE directly through PHP.Access link in private.
Thanks for the help,
Rob
Added info:
I found this post asking almost the same:
https://kriesi.at/support/topic/bulk-enable-advanced-layout-builder-on-pages/
So I added this coe from Mike to functions.php in the child theme (with updated deprecated function of course):// ***** TEST trigger ALB editor always on load, regardless of previous saving *****/ function trigger_alb_on_load(){ ?> <script> (function($){ $(window).on('load', function () { $("#avia-builder-button").trigger('click'); }); })(jQuery); </script> <?php } add_action('admin_head-post-new.php', 'trigger_alb_on_load');
Bur unfortunately it doesn’t make a difference, it still respects/opens with the editor/view in which the page was last saved.
- This reply was modified 2 years, 12 months ago by rob2701.
November 26, 2021 at 6:57 am #1330543Hi rob2701,
Thanks for providing us with admin access, I have checked it and although I could see the issue you mentioned but I could not replicate the issue on my end.
Can you setup a staging site for us? so we can try to troubleshoot it without risking your live site.
Here’s a simple tutorial you can follow if you don’t have experience creating one before: https://themeisle.com/blog/wordpress-staging-site/Best regards,
NikkoNovember 26, 2021 at 8:34 am #1330558Hi Nikko,
This IS a staging site, a direct copy of the live one :-)
You can do anything you want there, it’s well backed up. As long as you make sure you re-enable the Password Protected plugin when you’re done (dev site should not be exposed to the public)Let me elaborate a bit and save you some time. To see what I mean you can open a page, go to Classic Text View, save it. Next time you open it through a link to edit, it will open in the last used mode, so classic text view.
I already described that quite clearly earlier.
Also, it is the same on a standard new site with just the Enfold Shop Demo imported. The LAST USED view is opened when you edit a page again.What I need is for the Advanced Layout Editor to open by default / be set as default, that’s all.
Enfold (as far as I know) does not provide the option to set the preferred editor for pages (and posts if necessary), like some other page builders do. I hereby would make that a real feature request, it would sit nicely in the General Settings, where now you can choose between Block and Classic only.
I have this set in the child theme functions.php, and that works well enough, but ONLY for NEW pages.
// ***** TEST #3 trigger ALB editor always on load, regardless of previous saving *****/ // >>>>> THIS WORKS WELL, BUT ONLY FOR _NEW_ PAGES (HOW TO ADAPT FOR EXISTING?) <<<<< // 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>#postdivrich_wrap { display: none; }</style>'; ?> <script> (function($){ $(window).on('load', function () { $("#avia-builder-button").trigger('click'); $("#postdivrich_wrap").css('display', 'inherit'); }); })(jQuery); </script> <?php } add_action('admin_head-post-new.php', 'trigger_alb_on_load');
Kind regards,
RobSee: https://kriesi.at/support/topic/always-open-advanced-layout-builder/#post-452117
- This reply was modified 2 years, 12 months ago by rob2701. Reason: Added clarification test imported demo site
November 30, 2021 at 3:09 am #1330903Hi Rob,
Thanks, this seems to be unusual behavior, but I was able to fix it by doing the following steps:
1. Disable all plugins
2. Switch from child theme to parent theme
3. Edit Homepage (or other page) then click the Advanced Layout Builder button to fix it. (No need to do it on multiple pages)
4. Switch back to the child theme and enable all pluginsBest regards,
NikkoNovember 30, 2021 at 7:52 am #1330940Hi Nikko,
Thank you for all the efforts and the time you spent on this, much appreciated. Unfortunately, the behavior is the same:
even with the code to always open the ALB editor as default, it is still the last used editor & view, all the time. No matter how much we try and test.By the way, it is the same on a clean new Enfold site with just a demo imported. Last used editor&view is remembered and opened, that is the standard behaviour, the added code does nothing to change that.
Testing:
1. add code to open item in ALB, regardless of previous opening mode
2. open an item, go to classic & text view, save
3. try to open item through link.
4. result: last used/saved view is always used again…I do realise I may have opened up a can of worms here, as choosing/setting the default/preferred editor has become much more complicated after WP threw Gutenberg into the mix and all the places this can be set (Settings, user profile, theme). More variables = more problems. ;-)
Regardless, I would like to repeat my original request and hope the related feature request can be be tackled at some point.I do realise everyone has a lot on their plates, but I would just like to know if it’s possible and if so, can it please be added to a future version?
So in short:
1. Is there a way to open an item in ALB editor directly through PHP? And/or link?
2. Feature request: ability to set prefererred editor in Enfold options, would be great if specifically for pages/posts/portfolios/customThanks for your time & have a good day,
Rob- This reply was modified 2 years, 11 months ago by rob2701. Reason: adding testing steps
December 6, 2021 at 4:25 pm #1331732Hi Rob,
Thanks for your patience and hope you had a nice weekend! I have checked with our devs and have the answers to your questions :)
1- There would be a big chance of breaking the content so unfortunately, there is no way at the moment.
2- Your request will be considered however this is the first time we have received such request so I am afraid it will have a low priority.Best regards,
YigitDecember 6, 2021 at 4:35 pm #1331737Hi Yigit,
No worries, I already suspected the request could have a lot of hidden issues because of all the variables involved :-)
Thanks for everyone’s time though, maybe someday it will be possible. Can be closed for now, thanks.Kind regards,
RobDecember 6, 2021 at 4:36 pm #1331738 -
AuthorPosts
- The topic ‘Access page in Advanced Layout Editor directly?’ is closed to new replies.