Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #516635

    Hi,
    is possible to hide some elements of the layout builder and the ability to create template page for editors users?
    I need to restrict most of the elements of the layout builder for editors and I need that they can load the template (that one of the builder) but not change or create others.
    Thank in advance for your support,
    regards

    #516925

    Hey!

    Try adding this at the very end of your theme / child theme functions.php file:

    
    add_action('admin_head', function() {
    if(current_user_can('editor')){
    	?>
    	<style>
    	 	a.save-template-button.button, span.avia-delete-template {
    	    	display: none;
    		}
    	</style>
        <?php
       }
    });

    Cheers!
    Josue

    #517398

    Hi,

    thanks, like this the button save and delete are hidden, great.

    Do you have a similar solution for the element of the layout builder? I have to hide the most and leave only a few.

    Thanks for your support

    #517404

    Hey!

    Could you please post which elements do you need to keep?

    Cheers!
    Yigit

    #517434

    Hi,
    I need to keep:
    Text block
    Separator/whitespace
    Special Heading
    Image
    Gallery
    Google Map

    Only this, all the other elements must be hidden.

    And if is possible I need to hide the function Insert theme shortcode in the default editor.

    Thank’s a lot for your support ;)

    #517804

    Hi!

    Please try this:

    add_action('admin_head', function() {
    if(current_user_can('editor')){
    	?>
    	<style>
            .shortcode_insert_button {
                display: none;
            }
    
    		a[href="#avia_sc_text"], a[href="#avia_sc_hr"], a[href="#avia_sc_heading"] a[href="#avia_sc_image"], a[href="#avia_sc_gallery"], a[href="#avia_sc_gmaps"] {
    			display: block;
    		}
    	</style>
        <?php
       }
    });

    Cheers!
    Ismael

    #518008

    Thank you!
    It works fine but displays only “text” “spaces” “gallery” and “google map”
    Are missing the “special headig” and “image” despite being included in the code

    Thanks for support

    #518014

    There’s a typo, try with this one:

    add_action('admin_head', function() {
    if(current_user_can('editor')){
    	?>
    	<style>
            .shortcode_insert_button {
                display: none;
            }
    
    		a[href="#avia_sc_text"], a[href="#avia_sc_hr"], a[href="#avia_sc_heading"], a[href="#avia_sc_image"], a[href="#avia_sc_gallery"], a[href="#avia_sc_gmaps"] {
    			display: block;
    		}
    	</style>
        <?php
       }
    });
    #518027

    ok now it works!
    just for curiosity, what is the difference between the two blocks of code? They look identical…

    If I can, i have another request.
    Is possible also to hide the button to enter the theme shortcode in the standard editor?

    Thanks again

    #518036

    There was a missing comma between the image/heading selectors. To disable the Magic Wand tool add the following to CSS code:

    div#mceu_15 {
        display: none;
    }

    Best regards,
    Josue

    #518059

    Perfect!
    Thanks a lot!

    #518136

    You are welcome, glad to help :)

    Regards,
    Josue

    #518658

    Hi, I have a problem with the layout builder in the post, if I use it the panel where I have to choose the image format disappeared and the featured image is not visible in the front end even if it is loaded and visible in the back end. I suppose that this must be a bug, do you have a solution for it?

    Thanks

    #518955

    Hi!

    Please create another topic regarding the issue, we’ll look into it.

    Regards,
    Josue

    #760029

    Hey,
    I hope it’s okay to answer to this topic.
    I’ve got the same problem but it doesn’t seem to work any longer with the following code you provided for hiding the templates in avia layout architekt.

    add_action('admin_head', function() {
    if(current_user_can('editor')){
    	?>
    	<style>
    	 	a.save-template-button.button, span.avia-delete-template {
    	    	display: none;
    		}
    	</style>
        <?php
       }
    });

    Can you provide a updated code which works on the newer enfold versions?

    Thanks in advance!
    Regards.

    #760450

    Hi,

    I think the code is supposed to only affect the editor role, did you try logging in with a user which has that role?

    Best regards,
    Rikard

    #760720

    Hi,
    my fault, sorry. I have the advances access manager and overlooked that the user I logged in with for testing isn’t an editor but a self-added role. When I replace “editor” with the right role it works perfectly fine.

    What code snippet do I have to add so that the user also can’t load templates?

    Best regards.

    #763507

    Hi,

    Sorry for the late reply. You can try hiding the button with CSS:

    add_action('admin_head', 'hide_template_button_for_editor_role');
    
    function hide_template_button_for_editor_role() {
      if(current_user_can('editor')){
        echo '<style>
          .avia-template-save-button-container {
            display:none !important;
          } 
      </style>';
      }
    }

    Best regards,
    Rikard

Viewing 18 posts - 1 through 18 (of 18 total)
  • You must be logged in to reply to this topic.