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
use Drupal\views\Views; | |
parse_str($_SERVER['QUERY_STRING'], $url_query_array); | |
$results_view = Views::getView('view_display_name'); | |
$results_view->setDisplay('view_machine_name'); | |
$results_view->setArguments($url_query_array); | |
$results_view->preExecute(); | |
$results_view->execute(); | |
$view_results_count = $results_view->total_rows; |
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
/* -------------------------- | |
* TABLE STYLING | |
* -------------------------- */ | |
$table-background-color: $color-white; | |
$table-background-color-even: $color-light-grey; | |
$table-cell-border-color: $color-mid-grey; | |
$thead-background-color: $color-dark-blue; | |
$thead-text-color: $color-white; |
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
import debounce from 'lodash/debounce'; | |
window.addEventListener('resize', debounce(resizeFunction, 100), false); | |
function resizeFunction() { | |
// If the window matches the media query then close the menu | |
if (window.matchMedia('(max-width: 1080px)').matches) { | |
// Resize things here. | |
} | |
} |
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
/* -------------------------- | |
* RESPONSIVE MIXINS | |
* -------------------------- */ | |
$respond-to-queries: (smartphone: 'all and (max-width: 600px)', | |
tablet-portrait: 'all and (max-width: 768px)', | |
tablet: 'all and (max-width: 1024px)', | |
desktop-medium: 'all and (max-width: 1240px)' | |
); |
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
use Drupal\Core\Form\FormStateInterface; | |
function hook_form_alter(&$form, FormStateInterface $form_state, $form_id) { | |
switch ($form_id) { | |
// Alter login form and add own custom submit handler. | |
case 'user_login_form': | |
$form['#submit'][] = '_statefair_user_login_form_submit'; | |
break; | |
} | |
} |
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 convert_number_to_word($num = FALSE) { | |
$num = str_replace([',', ' '], '', trim($num)); | |
if (!$num) { | |
return FALSE; | |
} | |
$num = (int) $num; | |
$words = []; | |
$list1 = [ | |
'', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', | |
'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen', |