Skip to content

Instantly share code, notes, and snippets.

@rubedell
rubedell / webform_copy-node-title
Created August 29, 2013 08:15
Webform block - copy node title to hidden field
function the_aim_custom_form_alter(&$form, &$form_state, $form_id) {
switch ($form_id) {
//apply for job form
case 'webform_client_form_38':
//get title of current node and insert into webform field
$current_object = menu_get_object();
if(isset($current_object->title)) {
$job_title = $current_object->title;
$form['submitted']['vacature']['#default_value'] = $job_title;
}
@rubedell
rubedell / content_overview.info
Created August 29, 2013 08:46
Content overview without views (nodes - terms)
name = the AIM custom
package = the AIM
core = 7.x
@vdchristelle
vdchristelle / page.tpl.php
Last active December 22, 2015 10:48
Ability to set linebreak in $h1_title Titel splitsen
<h1><?php print str_replace('[', '<span>', str_replace(']', '</span>', $h1_title)); ?></h1>
of <h1><?php print str_replace(array('[', ']'), array('<span>', '</span>'), $h1_title); ?></h1>
@rubedell
rubedell / latest_product.php
Created October 28, 2013 10:45
Latest product (withouth views)
<?php
/**
* Implements hook_block_info().
*/
function the_aim_custom_block_info() {
$blocks['latest_product'] = array(
'info' => t('Latest product'),
);
return $blocks;
}
$('form :input').each(function(index, elem) {
var eId = $(elem).attr('id');
var label = null;
if (eId && (label = $(elem).parents('form').find('label[for='+eId+']')).length === 1) {
$(elem).attr('placeholder', $(label).html());