15); return $options; } /** * {@inheritdoc} */ public function options_form(&$form, &$form_state) { $form['example_option'] = array( '#type' => 'textfield', '#title' => t('Some example option.'), '#default_value' => $this->options['example_option'], ); } /** * {@inheritdoc} */ public function options_validate(&$form, &$form_state) { if ($form_state['values']['options']['argument_default']['{{ plugin_machine_name }}']['example_option'] == 10) { form_error($form['example_option'], t('The value is not correct.')); } } /** * {@inheritdoc} */ public function options_submit(&$form, &$form_state, &$options) { $options['example_option'] = $form_state['values']['options']['argument_default']['{{ plugin_machine_name }}']['example_option']; } /** * {@inheritdoc} */ public function get_argument() { // @DCG // Here is the place where you should create a default argument for the // contextual filter. The source of this argument depends on your needs. // For example, you can extract the value from the URL or fetch it from // some fields of the current viewed entity. // For now lets use example option as an argument. $argument = $this->options['example_option']; return $argument; } }