Elementor: Why this control won't trigger _content_template()?

Created on 22 Mar 2018  路  3Comments  路  Source: elementor/elementor

Hi, I built a custom widget, and has this control among others. It does work, but won't trigger _content_template(), so no real time preview. Why?

$this->add_control(
  'optional_type',
  [
    'label' => __( 'Optional', 'lr' ),
    'type' => Controls_Manager::SELECT,
    'default' => 'solid',
    'prefix_class' => 'option-',
    'options' => [
      'drum-separator' => __('Drum Separator','lr')
      ,'dumbo-system' => __('Dumbo system','lr')
      ,'electrical-box-on-consolle' => __('Electrical box on consolle','lr')
      ,'humidity-control' => __('Humidity control','lr')
      ,'infra-red' => __('Infra-red','lr')
      ,'drum-with-small-perforation' => __('Drum with small perforation','lr')
      ,'product-injection' => __('Product injection','lr')
      ,'steam-injection' => __('Steam injection','lr')
      ,'teflon-drum-door' => __('Teflon drum & door','lr')
      ,'touch-screen' => __('Touch-screen','lr')
      ,'trolley-tilter' => __('Trolley tilter','lr')
      ,'tumbler-conversion' => __('Tumbler conversion','lr')
      ,'tutor' => __('"Tutor"','lr')
    ]
  ]
);
typdeveloper-api

Most helpful comment

Can't find a reference to the 'render_type' option in developer docs

All 3 comments

Simply because you have set prefix-class.

if you want content al well then add 'render_type' => 'template'.

OK Thank you

Can't find a reference to the 'render_type' option in developer docs

Was this page helpful?
0 / 5 - 0 ratings