Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #923548

    Hi,

    I attempted to create a custom avia shortcode for the page builder for extending the library.

    I found out that:

    Enfold loads avia shortcodes by looping through all of the declared classes that have been declared in that request and checking if they extend aviaShortcodeTemplate. This is doing more work than it has to.

    Enfold uses the class name as the href of the shortcode’s icon in the template builder. This breaks the link and the template disappears when dropping it onto the editing pane.

    Shortcode Template Icon in on the page editor:

    
    <a data-avia-tooltip="Creates a simple text block" data-dragdrop-level="3" href="#SomeNamespace\avia_sc_text" class="shortcode_insert_button  avia-target-insert ui-draggable ui-draggable-handle"><img src="http://localhost/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/images/sc-text_block.png" alt="Text Block"><span>Text Block</span></a>
    

    As you can see href="#SomeNamespace\avia_sc_text" is an invalid link.

    Possible Solutions:

    One possible solution to this could be replacing ‘\’ with ‘_’ and check for that in referencing locations. But this could potentially confuse two classes as the same class. ex. namespace\class ans namespace_class. These are two conventions available.

    A better approach would be declaring a method abstract so the subclass can declare the tag it should have.

    One possible improvement for the loader is to use a filter based system instead. Filter an array to add class names. Loop through the array and initialize only those templates. This
    prevents looping over all declared classes which will lead to better execution time.

    Let me know your thoughts,
    Jason Gallavin

    #923717

    Hey louisvillegeek,

    Thanks for giving us your feedback and suggestion. :) I’ll forward your message to Kriesi and our devs.

    Best regards,
    Nikko

    #924269

    Hi Nikko,

    Thank you for forwarding it. :)
    Let me know what they think.

    Thanks,
    Jason

    #925036

    Hi,

    There are multiple updates coming to ALB so that will also be added in a way to make sure that we are not loading things that we should not!

    Best regards,
    Basilis

    #926368

    Hi Basilis,

    That sounds great! Will these updates contains a fix for the ‘\’ character in name-spaced classes?

    Thanks,
    Jason

    #927651

    Hi,

    It depends on the amount of things we will push on the next update – but yes we can make it basically based on that.
    If it is not on the next, it will sure be one of the upcming releases.

    Just so you know, we appreciate that type of feedback really.
    We are working to almost re-write the Avia Builder so those things will help us make it beter!

    If you notice anything else that you have feedback – please let us know!

    Best regards,
    Basilis

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘avia-template-builder Improvement’ is closed to new replies.