Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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 3 years, 1 month ago by rob2701. Reason: added remark
    #1330219

    Hi 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,
    Nikko

    #1330262

    Hi 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 3 years ago by rob2701.
    #1330543

    Hi 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,
    Nikko

    #1330558

    Hi 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,
    Rob

    See: https://kriesi.at/support/topic/always-open-advanced-layout-builder/#post-452117

    • This reply was modified 3 years ago by rob2701. Reason: Added clarification test imported demo site
    #1330903

    Hi 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 plugins

    Best regards,
    Nikko

    #1330940

    Hi 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/custom

    Thanks for your time & have a good day,
    Rob

    • This reply was modified 3 years ago by rob2701. Reason: adding testing steps
    #1331732

    Hi 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,
    Yigit

    #1331737

    Hi 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,
    Rob

    #1331738

    Hey,

    Thanks for your understanding, Rob :)

    Let us know if you have any other questions and enjoy the rest of your day!

    Regards,
    Yigit

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Access page in Advanced Layout Editor directly?’ is closed to new replies.