-
AuthorPosts
-
June 28, 2023 at 5:50 pm #1411970
Hello
I would like to create my own ALB element, which should serve as a container for content and media elements similar to the columns and can be inserted as a child element of color sections, for example. The container should be able to hold all content/media elements that do not extend over the entire width. In the frontend, the element should only display a div around its content. Ideally, the container element can even be placed inside columns to create a new hierarchy level (color section – column – custom container – content/media elements). However, this does not have to be the case if this is not possible.
Now I wanted to start from the existing column elements and customize the code. However, the code includes many functions that I do not need at all. Do you have a better template that I can use?
Many thanks and kind regards
June 29, 2023 at 7:29 am #1412021Hey Jeannette,
Thank you for the inquiry.
What type of content or media would you like to insert on the page? Have you tried using the Gallery or Image elements available in the builder? If you require an element that can be added as a child of another element (such as columns or color sections), you can begin with the Text Block template or any elements inside the Content Elements tab.
Best regards,
IsmaelJune 29, 2023 at 9:26 am #1412029Hi Ismael
Thank you very much for your quick reply.
At the moment I have the following structure:
<flex_column> <avia-image-container></avia-image-container> <av_textblock_section></av_textblock_section> <avia-button-wrap></avia-button-wrap> </flex_column>
However, I need the following structure so that I can style the content as desired:
<flex_column> <container> <avia-image-container></avia-image-container> <av_textblock_section></av_textblock_section> <avia-button-wrap></avia-button-wrap> </container> </flex_column>
Thanks for your support.
- This reply was modified 1 year, 4 months ago by blende64.
July 13, 2023 at 7:26 am #1413192Hi,
We would like to apologize for the delay. Instead of creating a new element, we can add a script that creates a new container inside the column element and moves other elements inside this new container. The column should have the class name “av-column-with-container”, which can be added in the Advanced > Developer Settings > Custom CSS Class field.
Please add the following code in the functions.php file, then in the builder, add a column element with the class name “av-column-with-container”.
function ava_custom_script() { ?> <script> (function($) { $(document).ready(function() { $('.av-column-with-container').each(function() { var container = $('<div class="av-column-container"></div>').appendTo(this); $(this).children().not('.av-column-container').appendTo(container); }); }); }(jQuery)); </script> <?php } add_action('wp_footer', 'ava_custom_script');
Best regards,
IsmaelJuly 13, 2023 at 9:52 am #1413208Hi Ismael
No problem. Good things come to those who wait.
Smart solution with the script. I will try to implement this with PHP, so that the HTML code is already delivered by the server as desired.Many thanks for your support.
July 20, 2023 at 9:46 am #1413811 -
AuthorPosts
- The topic ‘Creating a custom ALB container element’ is closed to new replies.