Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Views contextual filter UI elements from Block Configuration #132

Closed
mrkmiller opened this issue Jul 24, 2017 · 1 comment
Closed
Assignees

Comments

@mrkmiller
Copy link
Contributor

Add config settings to the sitefarm_core.settings.php file for the context keys that should be hidden on blocks created by views.

// Remove Views contextual filter UI elements from Block Configuration
  if ($form_id == 'block_form' && !empty($form['settings']['context_mapping'])) {
    $context_keys = [
      'nid',
      'nid_1',
      'tid',
      'field_sf_gallery_category_target_id',
    ];
    foreach ($context_keys as $key) {
      if (array_key_exists($key, $form['settings']['context_mapping'])) {
        $form['settings']['context_mapping'][$key]['#access'] = FALSE;
      }
    }
  }
@mrkmiller mrkmiller self-assigned this Jul 24, 2017
@mrkmiller
Copy link
Contributor Author

Duplicate of #96

@mrkmiller mrkmiller marked this as a duplicate of #96 Jul 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant