This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In your themes functions.php: | |
add_filter( 'embed_oembed_html', 'custom_oembed_filter', 10, 4 ) ; | |
function custom_oembed_filter($html, $url, $attr, $post_ID) { | |
$return = '<div class="video-container">'.$html.'</div>'; | |
return $return; | |
} | |
In your themes css: | |
.video-container { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Popolo Custom | |
type: module | |
description: 'Example module for Drupal 8.' | |
package: Custom | |
version: 8.x | |
core: 8.x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function popolo_custom_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id){ | |
/** | |
* Apply the form_alter to a specific form #id | |
* the form #id can be found through inspecting the markup | |
*/ | |
if($form['#id'] == 'views-exposed-form-filter-articles-page-1') { | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
popolo_custom.forms: | |
version: VERSION | |
css: | |
theme: | |
css/popolo_custom.theme.css: {} | |
popolo_custom.enable: | |
version: VERSION | |
js: | |
js/popolo_custom.js: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
/** | |
* Set active class on Views AJAX filter | |
* on selected category | |
*/ | |
Drupal.behaviors.exposedfilter_buttons = { | |
attach: function(context, settings) { | |
$('.filter-tab a').on('click', function(e) { | |
e.preventDefault(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Hide <select> and submit-button | |
*/ | |
#views-exposed-form-filter-articles-page-1 .form-type-select { | |
display: none; | |
} | |
#views-exposed-form-filter-articles-page-1 .form-submit { | |
display: none; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const myTest = (string) => {console.log(string)}; |