Skip to content

Instantly share code, notes, and snippets.

View jacecotton's full-sized avatar

Jace Cotton jacecotton

  • Texas Children's Hospital
  • Houston, TX
View GitHub Profile
{{ path("entity.node.canonical", {"node": NID}) }}
@jacecotton
jacecotton / node-from.php
Last active March 27, 2024 16:37
Methods to derive node object
<?php
/**
* Once we have access to a node object we can e.g. `dump($node)` to
* discover properties, like `$node->get("field_example")->getValue()`
* or `$node->nid->getValue()[0]["value"]`.
*
* @todo - If we just need the node object of the current page, we
* probably don't need to derive it. But what exactly is the reference
* to the current node?
*/
@jacecotton
jacecotton / settings.local.php
Created May 2, 2023 20:19
Enable visibility of JSON API for Site Studio component form
// Place at end of file
$settings['dx8_json_fields'] = TRUE;
$settings['dx8_editable_api_url'] = TRUE;