public function register_customisations() {
+ //--- Heading Widget
// Extend Elementor's heading widget to add a CSS class based on the alignment setting so we can also control the position of the underline
add_action( 'elementor/element/heading/section_title/before_section_end', function( $element, $args ) {
$elementor = Plugin::instance();
// Todo: consider add a control to the existing heading widget that allows the underline to be disabled (via prefix_class?)
+
+ //--- Toggle Widget
+ // Override default icons
+ add_action( 'elementor/element/toggle/section_toggle/before_section_end', function( $element, $args ) {
+ $elementor = Plugin::instance();
+ $icon_control = $elementor->controls_manager->get_control_from_stack( $element->get_name(), 'icon' );
+ $icon_active_control = $elementor->controls_manager->get_control_from_stack( $element->get_name(), 'icon_active' );
+
+ if (is_wp_error($icon_control) || is_wp_error($icon_active_control)) {
+ return;
+ }
+
+ $icon_control['default'] = 'fa fa-chevron-right';
+ $element->update_control( 'icon', $icon_control );
+
+ $icon_active_control['default'] = 'fa fa-chevron-down';
+ $element->update_control( 'icon_active', $icon_active_control );
+ }, 10, 2);
+
+
}
public function register_widgets() {
class ProfileGrid extends Widget_Base {
- protected $_has_template_content = false; // Tell Elementor that content is all rendered dynamically
+ protected $_has_template_content = true;
// Widget name / ID
public function get_name() {
echo '<div class="profile-grid">'. $html .'</div>';
}
+ /**
+ * Render widget output in the editor.
+ *
+ * Written as a Backbone JavaScript template and used to generate the live preview.
+ *
+ * @since 1.0.0
+ * @access protected
+ */
+ protected function _content_template() {
+ ?>
+ <div class="profile-grid">
+ <#
+ if ( settings.items ) {
+
+ _.each( settings.items, function( item, index ) {
+ #>
+ <div class="profile-grid-item">
+
+ <img src="{{ item.image.url }}" class="profile-grid-image">
+
+ <div class="profile-grid-text">
+
+ <h3 class="profile-grid-title">{{{ item.title }}}</h3>
+
+ <# if ('' !== item.subtitle) { #>
+ <h4 class="profile-grid-subtitle">{{{ item.subtitle }}}</h4>
+ <# } #>
+
+ <div class="profile-grid-body">
+ {{{ item.body }}}
+ </div>
+
+ <# if ('' !== item.cta_text && '' !== item.cta_link.url) { #>
+ <a href="{{ item.cta_link.url }}" class="profile-grid-cta">
+ <?= \BladeSvgSage\svg_image('arrow')->toHtml() ?>
+ {{ item.cta_text }}
+ </a>
+ <# } #>
+ </div>
+
+ </div>
+ <#
+ });
+ } #>
+ </div>
+ <?php
+ }
+
}
.disable-vertical-spacing
padding-top: 0 !important
padding-bottom: 0 !important
+
+.indent-content
+ constrain(padding-left, 7.5vw)
--- /dev/null
+.elementor-toggle
+
+ .elementor-toggle-item
+ margin-bottom: 1em
+
+ .elementor-toggle-icon
+ font-size: 0.8em
+ margin-top: 3px
+ margin-right: 0.9em
+
+ .elementor-tab-title
+ outline: none
+ color: $colors.headings
+ font-size: 26px
+ font-weight: 600
+ border-bottom: none
+
+ .elementor-tab-content
+ margin-left: 2.7em
+ border-bottom: none