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
<ol> | |
{% for key, value in _context %} | |
<li>{{ key }}</li> | |
{% endfor %} | |
</ol> | |
Or you can use: | |
{{ dump(_context|keys) }} |
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
https://twitter.com/intent/tweet?text=I%27m%20standing%20with%20Dave%20Brat%21&hashtags=standwithbrat&url=http://www.standwithbrat.com |
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
isset($_GET['mykey']) ? $_GET['mykey'] : "" |
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
drush pml --no-core --type=module --status=enabled --pipe | xargs drush -y dis |
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 | |
while ( have_posts() ) : the_post(); ?> <!--Because the_content() works only inside a WP Loop --> | |
<div class="entry-content-page"> | |
<?php the_content(); ?> <!-- Page Content --> | |
</div><!-- .entry-content-page --> | |
<?php | |
endwhile; //resetting the page loop | |
wp_reset_query(); //resetting the page query | |
?> |
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 NAME_views_api() { | |
return array( | |
'api' => 3, | |
'path' => drupal_get_path('module', 'NAME'), | |
'template path' => drupal_get_path('module', 'NAME'), | |
); | |
} | |
This will tell Views to look in the root directory of your module. I personally am a fan of adding a subdirectory to the module to hold template files. To do this append the directory name to the end of the template path, eg: | |
'template path' => drupal_get_path('module', 'NAME') . '/templates', |
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
Sync DB between two boxes - drush sql-sync @dev @jasons | |
Sync files between two boxes - drush rsync @dev:%files @jasons:%files |
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
$rows = 1; | |
if (($handle = fopen("<path to csv file>", "r")) !== FALSE) { | |
echo '<table class="table table-bordered toggle-square-filled default breakpoint footable">'; | |
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { | |
$num = count($data); | |
if ($rows == 1) { | |
echo '<thead><tr>'; |
NewerOlder