This file contains hidden or 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\node\NodeInterface; | |
use Drupal\Core\Template\Attribute; | |
use Drupal\Core\Url; | |
/** | |
* Implements hook_preprocess_page() for page.html.twig. | |
*/ | |
function THEME_preprocess_page(&$vars) { | |
// Add sitename and slogan to page. | |
$vars['site_name'] = \Drupal::config('system.site')->get('name'); |
This file contains hidden or 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 | |
/** | |
* Debugging using the database connection. | |
*/ | |
/** @var \Drupal\Core\Database\Connection */ | |
$connection = \Drupal::service('database'); | |
$query = $connection->select('node', 'node'); | |
$query->fields('node', ['nid']) |
This file contains hidden or 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 | |
// Get the Role ID we want to add all permissions to | |
$rid = user_role_load_by_name('Super Administrator')->rid; | |
// Get a listing of all of the permissions | |
$perms = array_keys(user_permission_get_modules()); | |
// Grant permissions for the role | |
user_role_grant_permissions($rid, $perms); |
This file contains hidden or 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
drush user-create adminuser --mail="adminuser@uiowa.edu" --password="UserPw"; drush user-add-role "administrator" adminuser |