Last active
February 9, 2019 22:46
-
-
Save aquelito/8325756 to your computer and use it in GitHub Desktop.
Drupal Snippet
- CSS Selector https://drupal.org/node/1707736
<?php drupal_set_message("<pre>".print_r($page['content'], true)."</pre>"); ?>
watchdog('vinci_tracker', 'Tracker :: visiteonline = %name', array('%name' => 'Vinci_Display'));
<?php file_build_uri($path); ?>
Avec nid
appeller le lien vers le node
<?php
$options = array('absolute' => TRUE);
$url = url('node/' . $fields['nid']->content, $options);
?>
<?php
print l('Libellé du lien', 'node/ID', array(
'attributes' => array(
'id' => array('MON_ID'),
'class' => array('MA_CLASSE')
),
'html' => true
));
?>
<?php print l('Libellé du lien', 'node/ID'); ?>
<?php print format_plural($count, t("@count comment"), t("@count comments")); ?>
<?php
$field_name = 'field_name';
$items_name = field_get_items('node', $currentnode, $field_name);
$vars['name_output'] = field_view_value('node', $currentnode, $field_name, $items_name [0]);
?>
<?php
$block = block_load('block', '5');
$output = drupal_render(_block_get_renderable_array(_block_render_blocks(array($block))));
print $output;
?>
$block = block_load('search', '0');
<?php
$blocks_to_render = array('14', '23', '12', '13');
foreach ($blocks_to_render as $idblock) {
$block = module_invoke('block', 'block_view', $idblock);
$blocks[] = render($block['content']);
}
$rand_keys = array_rand($blocks, 1);
echo $blocks[$rand_keys[0]] . "\n";i
?>
Aller sur le site pour plus d'infos http://www.wdtutorials.com/2012/04/16/drupal-7-how-print-blocks-templates#.UlexTlDIWM4
<?php
function starter_js_alter(&$js)
{
unset($js[drupal_get_path('module', 'panels').'/js/panels.js']);
unset($js[drupal_get_path('module', 'views').'/js/views.js']);
unset($js[drupal_get_path('module', 'views').'/js/ajax_view.js']);
unset($js[drupal_get_path('module', 'views').'/js/base.js']);
}
?>
<?php
$path = trim($_GET['q'], '/'); // get the current normal drupal path
$path = drupal_get_path_alias($path); // get its alias
$path = explode('/', $path); // and break it up
if (path[0] == 'users' ) {
// do something
}
?>
print views_embed_view('user_domain', 'block_1');
# Block content
$block = module_invoke('views', 'block_view', 'user_domain-block_1');
print $block['content']['#markup'];
<?php if ($_SERVER['SERVER_NAME'] !== 'aquelito.fr'): ?>
<meta name="robots" content="noindex, nofollow" />
<?php endif ?>
function default_form_alter(&$form, &$form_state, $form_id) {
if (isset($form_id) && $form_id === 'views_exposed_form')
{
$form['submit']['#value'] = t('Apply');
$form['reset']['#value'] = t('Reset');
}
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment