PluginProbe
Elementor Website Builder – more than just a page builder / trunk
Elementor Website Builder – more than just a page builder vtrunk
4.3.3 4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 All 456 releases
← All changes | modules/atomic-widgets/elements/div-block/div-block.php +27 -2 4.0.9 → trunk View file →
@@ -1,8 +1,10 @@
1 1 <?php
2 2 namespace Elementor\Modules\AtomicWidgets\Elements\Div_Block;
3 3
4 4 use Elementor\Modules\AtomicWidgets\Elements\Base\Atomic_Element_Base;
5 +use Elementor\Modules\AtomicWidgets\Elements\Base\Has_Element_Template;
6 +use Elementor\Modules\AtomicWidgets\Elements\Base\Html_Tag_Computer;
5 7 use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type;
6 8 use Elementor\Modules\AtomicWidgets\PropTypes\Size_Prop_Type;
7 9 use Elementor\Modules\AtomicWidgets\Styles\Style_Definition;
8 10 use Elementor\Modules\AtomicWidgets\PropTypes\Attributes_Prop_Type;
@@ -20,8 +22,10 @@
20 22 exit; // Exit if accessed directly.
21 23 }
22 24
23 25 class Div_Block extends Atomic_Element_Base {
26 + use Has_Element_Template;
27 +
24 28 const BASE_STYLE_KEY = 'base';
25 29
26 30 public function __construct( $data = [], $args = null ) {
27 31 parent::__construct( $data, $args );
@@ -31,8 +35,10 @@
31 35 public static function get_type() {
32 36 return 'e-div-block';
33 37 }
34 38
39 + public static $widget_description = 'A block container (div) for grouping and wrapping content, with default styles (see llm_guidance.default_styles).';
40 +
35 41 public static function get_element_type(): string {
36 42 return 'e-div-block';
37 43 }
38 44
@@ -40,9 +46,9 @@
40 46 return esc_html__( 'Div block', 'elementor' );
41 47 }
42 48
43 49 public function get_keywords() {
44 - return [ 'ato', 'atom', 'atoms', 'atomic' ];
50 + return [ 'ato', 'atom', 'atoms', 'atomic', 'container', 'wrapper', 'section', 'row', 'column', 'div', 'box', 'layout' ];
45 51 }
46 52
47 53 public function get_icon() {
48 54 return 'eicon-div-block';
@@ -47,8 +53,12 @@
47 53 public function get_icon() {
48 54 return 'eicon-div-block';
49 55 }
50 56
57 + public static function get_computed_html_tag( array $settings ): string {
58 + return Html_Tag_Computer::compute( $settings, 'div' );
59 + }
60 +
51 61 protected static function define_props_schema(): array {
52 62 $tag_dependencies = Dependency_Manager::make( Dependency_Manager::RELATION_AND )
53 63 ->where( [
54 64 'operator' => 'ne',
@@ -71,10 +81,11 @@
71 81 return [
72 82 'classes' => Classes_Prop_Type::make()
73 83 ->default( [] ),
74 84 'tag' => String_Prop_Type::make()
75 - ->enum( [ 'div', 'header', 'section', 'article', 'aside', 'footer', 'a', 'button' ] )
85 + ->enum( [ 'div', 'header', 'section', 'article', 'aside', 'footer', 'a', 'button', 'main', 'nav' ] )
76 86 ->default( 'div' )
87 + ->description( 'The HTML tag for the div block container. One of: div, header, section, article, aside, footer, main, nav, a (link), or button. Do not use heading or paragraph tags.' )
77 88 ->set_dependencies( $tag_dependencies ),
78 89 'link' => Link_Prop_Type::make(),
79 90 'attributes' => Attributes_Prop_Type::make()->meta( Overridable_Prop_Type::ignore() ),
80 91 ];
@@ -111,8 +122,16 @@
111 122 [
112 123 'value' => 'footer',
113 124 'label' => 'Footer',
114 125 ],
126 + [
127 + 'value' => 'main',
128 + 'label' => 'Main',
129 + ],
130 + [
131 + 'value' => 'nav',
132 + 'label' => 'Nav',
133 + ],
115 134 ])
116 135 ->set_fallback_labels( [
117 136 'a' => 'a (link)',
118 137 ] )
@@ -182,6 +201,12 @@
182 201 $attributes = array_merge( $attributes, $link_attributes );
183 202 }
184 203
185 204 $this->add_render_attribute( '_wrapper', array_merge( $initial_attributes, $attributes ) );
205 + }
206 +
207 + protected function get_templates(): array {
208 + return [
209 + 'elementor/elements/div-block' => __DIR__ . '/div-block.html.twig',
210 + ];
186 211 }
187 212 }