Ohad Raz

Building a simple Custom Widget with Javascript

Are you building a custom Elementor widget, and looking to add some Javascript functionality to it? You’ve come to the right place. Elementor has a best practice for adding Javascript handlers to custom widgets, which we are going to cover in this blog post. We will build a simple, Javascript-powered widget together, explaining every step of the process.

In addition to this blog post, our Developers site also has official documentation on adding JS to widgets.

(more…) Read More »

New Control: Icons

Elementor 2.6.0 is just around the corner and with it, we are introducing a new Icons control which loads the new Elementor’s homemade Icon Library.

This new control allows easier upgrading of Font Awesome versions while supporting older versions for backward compatibility. On top of that, it introduces support for SVG icons and in the near future, will support custom icon font libraries.

Usage:

Start by adding the control to your widget in the widget’s class _register_controls() method, just like any other control in Elementor.

protected function _register_controls() {
	//...
	$this->add_control(
		'icon',
		[
			'label' => __( 'Icon', 'text-domain' ),
			'type' => Controls_Manager::ICONS,
			'default' => [
				'value' => 'fas fa-star',
				'library' => 'solid',
			],
		]
	);
	//...
}
(more…) Read More »