Skip to content

Instantly share code, notes, and snippets.

@anthonyringoet
Created April 3, 2012 08:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anthonyringoet/2290408 to your computer and use it in GitHub Desktop.
Save anthonyringoet/2290408 to your computer and use it in GitHub Desktop.
Remove contextual links when using Semantic Views to cleanup view rows - drupal
<?php
/**
* Implements template_preprocess_views_view
* if we're using Semantic Views to remove all the rows,
* things can get messy with nth-child selectors in css because
* of the dirty contextual links in the title_suffix.
* Remove them automatically when using Semantic Views and stripping out row markup.
*/
function YOURTHEME_preprocess_views_view(&$vars) {
$view = $vars['view'];
if(isset($view->style_plugin) && isset($view->style_options)){
if(get_class($view->style_plugin) == 'semanticviews_plugin_style_default' && $view->style_options['row']['element_type'] == ''){
unset($vars['title_suffix']);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment