I hereby claim:
- I am petebarnett on github.
- I am petebarnett (https://keybase.io/petebarnett) on keybase.
- I have a public key whose fingerprint is D838 25D0 BB56 0E4C B7E9 DEB2 F5AA 5CD6 E467 8BC2
To claim this, I am signing this object:
<?php | |
template_preprocess_node(&$vars) { | |
$field_name = 'your_entityreference_field'; | |
$nid = $vars['content'][$field_name]['#items'][0]['target_id']; | |
// Add a flag to the referenced node for theming | |
$vars['content'][$field_name][0]['node'][$nid]['#node']->some_arbitrary_flag = 'some arbitrary value'; |
<?php | |
/** | |
* Implements hook_theme(). | |
*/ | |
function ds_extras_tokens_theme() { | |
// Declare our own theme hook, to add to the | |
// theme_hook_suggestions for 'field' | |
return array( |
class Test { | |
function getSomething($something) { | |
return $something; | |
} | |
} | |
$blah = new Test(); |
(function($) { | |
var beforeSend = Drupal.ajax.prototype.beforeSend; | |
Drupal.ajax.prototype.beforeSend = function(xmlhttprequest, options) { | |
// Do your thing here... | |
// And call the original | |
beforeSend.call(this, xmlhttprequest, options); | |
} |
destination: | |
plugin: entity:your_custom_entity_type | |
process: | |
type: | |
plugin: default_value | |
default_value: your_bundle |
id: the_content | |
label: Your Content Migration | |
migration_group: whatever_you_call_this_group | |
source: | |
plugin: your_content_source | |
destination: | |
plugin: entity:your_content_type | |
process: |
<?php | |
try { | |
new RecursiveArrayIterator(NULL); | |
} | |
catch(Exception $e) { | |
print $e->getMessage(); | |
} | |
// prints "Passed variable is not an array or object, using empty array instead" |
<?php | |
$referenced_files = $node->get('your_field')->referencedEntities(); | |
$vars['download_article'] = file_create_url($referenced_files[0]->uri->value); |
<?php | |
namespace Drupal\yourmodule\Plugin\Field\FieldType; | |
use Drupal\Core\Field\FieldItemBase; | |
use Drupal\Core\Field\FieldStorageDefinitionInterface; | |
use Drupal\Core\TypedData\DataDefinition; | |
use Drupal\zuora\Plugin\DataType\Account; | |
use Drupal\zuora\TypedData\Definition\AccountDefinition; |
I hereby claim:
To claim this, I am signing this object: