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 this simple script in empty aliases sitaution, when you have many rows | |
// in "url_alias" table with "source" column being empty. | |
$query = db_select('url_alias', 'ua')->fields('ua'); | |
$query->condition('ua.source', '', '='); | |
//$query->range(0, 500); // uncomment if plan to do this job in smaller chunks | |
$paths = $query->execute()->fetchAll(); | |
foreach($paths as $object) { | |
if (is_numeric($object->pid)) { | |
path_delete($object->pid); |
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
// paste it in your config.user.php configuration file in section files: {} | |
"syslog": { | |
"display" : "Drupal", | |
"path" : "\/var\/log\/drupal.log", //set your Drupal syslog file path | |
"refresh" : 5, | |
"max" : 10, | |
"notify" : true, | |
"order" : -1,//set order you want | |
"sort" : "Date", | |
"thinit" : [ "Date", "Site", "Type", "Request", "Referer", "UID", "Message" ], |
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 | |
/** | |
* @file Custom modal using ctools modal window | |
* more infor in sites/modules/ctools/help/modal.html your local drupal's installation | |
*/ | |
/** | |
* Implements of hook_menu() | |
*/ | |
function custom_popup_menu() { |
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
theme('image_style', array( | |
'style_name' => 'machine_name_of_image_style', | |
'path' => $file->uri, | |
'alt' => 'Alternative name atribute', | |
'title' => 'Title atribute' | |
) | |
); |
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
// get contact webform | |
$node = node_load(xx); | |
$submission = (object) array(); | |
$enabled = TRUE; | |
$preview = FALSE; | |
$contact_form = drupal_get_form('webform_client_form_xx', $node, $submission, $enabled, $preview); |
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
/** | |
* Remeber to set child element at least to | |
* display: inline-block; | |
* vertical-align: middle; | |
* More info and credits: http://css-tricks.com/centering-in-the-unknown/ | |
*/ | |
%ghostValign(){ | |
&:before { | |
content: ''; | |
display: inline-block; |