Skip to content
Snippets Groups Projects
Commit 98d51471 authored by Konstantinos Platis's avatar Konstantinos Platis
Browse files

Added Event Grid as display format

parent 2743e0d1
No related branches found
No related tags found
1 merge request!36Merge RC-v1.4.0 to master
.event-grid .views-row {
height: 297px; }
.event-grid .views-row .agenda-box-pattern {
height: 100%; }
/*# sourceMappingURL=event-grid.css.map */
.event-grid{
.views-row{
height: 297px;
.agenda-box-pattern{
height: 100%;
}
}
}
\ No newline at end of file
...@@ -8,4 +8,10 @@ featured-banner-stylesheets: ...@@ -8,4 +8,10 @@ featured-banner-stylesheets:
version: 1.x version: 1.x
css: css:
layout: layout:
assets/css/featured-banner.css: {} assets/css/featured-banner.css: {}
\ No newline at end of file
event-grid-stylesheets:
version: 1.x
css:
layout:
assets/css/event-grid.css: {}
\ No newline at end of file
...@@ -55,5 +55,8 @@ function cern_display_formats_views_post_render(ViewExecutable $view, &$output, ...@@ -55,5 +55,8 @@ function cern_display_formats_views_post_render(ViewExecutable $view, &$output,
$view->display_handler->setOption('css_class', 'accordion-cern'); $view->display_handler->setOption('css_class', 'accordion-cern');
} elseif ($view->display_handler->view->style_plugin->getPluginId() == "card_grid") { } elseif ($view->display_handler->view->style_plugin->getPluginId() == "card_grid") {
$view->display_handler->setOption('css_class', 'cern-view-display-page cern-view-display-resources'); $view->display_handler->setOption('css_class', 'cern-view-display-page cern-view-display-resources');
} elseif ($view->display_handler->view->style_plugin->getPluginId() == "event_grid") {
$view->display_handler->setOption('css_class', 'event-grid');
$output['#attached']['library'][] = "cern_display_formats/event-grid-stylesheets"; //attaches the stylesheet
} }
} }
\ No newline at end of file
<?php
namespace Drupal\cern_display_formats\Plugin\views\style;
use Drupal\core\form\FormStateInterface;
use Drupal\views\Plugin\views\style\DefaultStyle;
/**
* Style plugin rendering as Event Grid
*
* @ingroup views_style_plugins
*
* @ViewsStyle(
* id = "event_grid",
* title = @Translation("Event Grid"),
* help = @Translation("Displays content as an Event Grid"),
* theme = "views_view_unformatted",
* display_types = {"normal"}
* )
*/
class EventGrid extends DefaultStyle {
protected $usesRowPlugin = true;
/**
* Does the style plugin support custom css class for the rows.
*
* @var bool
*/
protected $usesRowClass = true;
protected $usesoptions = true;
protected $renderFields = true;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment