Skip to content

Instantly share code, notes, and snippets.

  1. Add core.entity_view_mode.paragraph.otp_toc.yml to cgov_core/config/install
  2. Add core.entity_view_display.paragraph.pdq_summary_section.otp_toc.yml to pdq_cancer_information_summary/config/
  3. add the code in pdq_cancer_information_summary.module to pdq_cancer_information_summary
{# Render the value of field only if it exists. #}
{% if not node.my_field.isEmpty() %}
<div class="some-class">
{{ node.my_field.value }}
</div>
{% endif %}
@bryanpizzillo
bryanpizzillo / ldock.sh
Created November 25, 2018 05:46
Function for running local docker compose and keeping project name
function ldock() {
# Find the root of the repo. Redirect stderr as if we are not
# under a repo an error will occur.
REPO_ROOT=`git rev-parse --show-toplevel 2> /dev/null`
if [ "$REPO_ROOT" == "" ]; then
echo "You must run this command from within a git repo."
return 1
fi