Tagged: avia, Custom Post Type, editing, Layout Builder, lock
-
AuthorPosts
-
February 1, 2017 at 7:59 am #741051
Hi ,
I have created a site that builds content from ACF fields using shortcodes placed within the layout builder template elements.
When ADDING NEW post to each of the 4 CPT’s – I have the Avia Layout Builder automatically loading the correct template file.The feature to be able to lock the layout builder for all other users other than admin – is great…
However I was hoping there is a specific HOOK that I can add to my child theme to also LOCK the ability to EDIT avia layout builder elements for a specific post type and user level.
- This topic was modified 7 years, 9 months ago by HuxburyQuinn.
February 6, 2017 at 5:17 am #743125Hey HuxburyQuinn,
Thank you for using Enfold.
This is not possible at this moment, unfortunately. You can only lock the whole advance layout builder for non-admins. Please request the feature in the following link.
// https://kriesi.at/support/enfold-feature-requests/
Best regards,
IsmaelFebruary 6, 2017 at 5:32 am #743128Hi Ismael,
thanks for your response.
Locking the Advance Layout builder only locks the position of the elements for non-admins.
The content within the element can still be edited.
is there a specific function that handles word press editing on the Advanced Layout builder
February 6, 2017 at 8:38 am #743202Hi!
We do not have something like that right now.
You can only block the hole editing, no just editing from ALB because the shortcodes of Builder will still be available
when editing from the editorBest regards,
BasilisFebruary 9, 2017 at 5:33 am #744589Hi Basilis,
Thanks for your response.
I tried to attack this from a different perspective, by trying to deactivate the Screen Options for ‘Avia Layout Builder’ – which in theory would hide the Avia Layout Builder Meta Box. However it seems that Avia Layout Builder has become non-responsive to Screen Options selection.
I then tried to Hide the ‘#avia_builder’ by adding style ‘display:none !important’ – again however this interfered with ‘Update’ post function.
As I have already enqueued javascript scripts specifically for admin – I ended up just closing the Avia Layout Builder Meta Box via jQuery add.class ‘closed’ to the ‘#avia_builder’.
This will do for now and will hopefully stop the client from editing the content other then via ACF.
Final script for custom post types…
1. Automatically Activate Avia Layout Builder
2. Automatically Load Correct Avia Template
3. Automatically Close Avia Layout Builder Meta Box
4. On Publish check that Avia Layout Builder is ActivatedAll because client’s click on things they aren’t meant too .
jQuery(document).ready (function ($) { // Automatically load Avia Layout Builder Template for Add New Post // Avia Templates are listed Alphabetically starting with click order 0 1 2 3 etc and are visible in the templates / Load Template // The list below a:eq() should be adjusted ( a:eq(0) a:eq(1) a:eq(2) etc. ) if a new template is added update or replaced // AVIA LAYOUT BUILDER - ADD NEW - ACTIVATE TEMPLATE for each POST TYPE // custom_post_type_1 // custom_post_type_2 // custom_post_type_2 // AVIA LAYOUT BUILDER - PUBLISH - MAKE SURE LAYOUT BUILDER IS ACTIVE var $body = $('body'); // custom_post_type_1 - ADD NEW / ACTIVATE TEMPLATE if ($body.hasClass ('post-type-custom_post_type_1')) { var $aviaBuilderButton = $('#avia-builder-button'); console.log($aviaBuilderButton); $(window).on ('load', function () { if ($body.hasClass('post-new-php')) { $aviaBuilderButton.click(); //avia-template-list-wrap load fist template in the list $('.avia-template-list-wrap a:eq(0)').click(); } //close avia layout builder metabox $('#avia_builder').addClass( 'closed' ); }); // if the avia layout builder is not selected on publish $('#publish').on('click', function (e) { console.info('CLICK PUBLISH'); if ($aviaBuilderButton.hasClass('avia-builder-active') == false) { $aviaBuilderButton.click(); } }); } // custom_post_type_2 - ADD NEW / ACTIVATE TEMPLATE - Repeat code });
cheers ;)
- This reply was modified 7 years, 9 months ago by HuxburyQuinn.
February 13, 2017 at 9:35 am #746254 -
AuthorPosts
- You must be logged in to reply to this topic.