Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #838507

    Hello,

    I found a nice and upgrade-safe way to acivate/deactivate single elements in the builder.
    This can be extended to ACL control or timed content without problems.
    I added a new attribute “disabled” to the elements globally and I also want to have a visual hint in the builder UI, to show that the element is disabled.
    But,I don’t find the right place to hook in safely – an option will be to modify the return-value of “editor_element()”. But I don’t see a hook for that.
    Does anybody here has an idea how to get this done?

    thanks
    -Elmar

    #838671

    Hey Elmar,

    What do you mean by this: “I also want to have a visual hint in the builder UI, to show that the element is disabled”? What kind of hint? Could you explain a bit more?

    Best regards,
    Victoria

    #840020

    Hi Victoria,

    sure, as a site is work-in-progress one might disable parts of the contents with my small code addition. There will be an additonal checkbox in my setup with “disable this element” if you edit an element. But in the overview you won’t see, if an element is currently disabled or not.
    Here I’d like to add a class to the visual builder, if an element has the attribute “disabled” = true

    In this case I might render the layout builder like this:
    http://www.evernote.com/shard/s2/sh/fee58f4e-0bb3-4de6-b0a9-9c64964cc252/41522809ee6427e12667302385256e55

    This will give us a similar functionality to Typo3, having active/inactive elements.
    https://docs.typo3.org/typo3cms/EditorsTutorial/singlehtml/_images/PageModuleColumns.png (No. 4)

    I’d like the idea in visual composer, where the builder UI shows e.g. the current background image and color as small spots
    http://www.evernote.com/shard/s2/sh/92418e73-fb51-49fc-87bd-a3c2397544f5/5b329753997778426fdfbf4897ffc1ee

    I would love to add similar extensions to the builder UI based on vaious attributes. But I don’t find an upgrade-safe place to add my code.

    I hope this is more clearly.
    Thanks
    -Elmar

    #840193

    Hi,

    This isnt included in our supports scope. To accomplish it, you`ll need to hire a freelance.

    Best regards,
    John Torvik

    #840923

    Hi John,

    I am confused…. it’s not a problem coding the modification for me – but it will be lost with the next update and I am seeking a hint, if someone has an idea for an upgrade-safe way to get this done. I don’t see any hook, filter or other mechansim that allows me to override this core functionality.

    Thanks

    Elmar

    #841930

    sorry, to be more precise: I changed two files, one for the initial loading, one for immediate update after saving the modal dialog

    /config-templatebuilder/avia-template-builder/php/shortcode-template.class.php
    in create_sortable_editor_element()

    if( $params['args']['disabled'] ) {
    	$class .= ' disabled';
    }

    and in config-templatebuilder/avia-template-builder/assets/js/avia-builder.js
    in update_builder_html()

    if( values.disabled == 'aviaTBdisabled' ) {
    	element_container.addClass('disabled');
    }
    else {
    	element_container.removeClass('disabled');
    }

    I am looking for a way/trick/hack to safely override these two points.

    #842329

    Hi,

    Have you tried using the “avb_backend_editor_element_data_filter” filter? For the script, try to create an inline script with the “wp_admin” hook..

    add_action( 'admin_head', 'ava_custom_admin_script' );
    function ava_custom_admin_script() {
    	// script here
    }

    Best regards,
    Ismael

    #843670

    Hi Ismael,
    thanks for your feedback. I checked my dev. theme here (might not be the latest, it is: 4.0.7), I don’t find a hook named “avb_backend_editor_element_data_filter”. It this something that has been added recently?
    Hooking admin_head for JS is fine, but I am dependant one values inside the update_builder_html() method, thus I cannot simply oberserve the backend from “outside”.
    Will keep on trying and researching ;-)

    Best
    -Elmar

    #843671

    update: just checked 4.1.2 and found a bunch of new entry points,
    Will check the updated code, before posting again here – thanks for pointing me into this direction.
    -Elmar

    #844281

    Hi,

    Alright. Let us know if you need anything else.

    Best regards,
    Ismael

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