Skip to content

Commit

Permalink
update clp node to be able to use url for field links
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Kim authored and Chris Kim committed Jul 18, 2024
1 parent f4a3472 commit 8fae1e3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/site/layouts/campaign_landing_page.drupal.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,15 @@
width="{{ promo.entity.fieldImage.entity.thumbnail.derivative.width }}"
/>
<h3 class="vads-u-padding-x--2 vads-u-margin-top--2">
<va-link
href="{{ promo.entity.fieldPromoLink.entity.fieldLink.uri }}"
text="{{ promo.entity.fieldPromoLink.entity.fieldLink.title }}"
></va-link>
{% assign fieldButtonUrl = promo.entityfieldPromoLink.entity.fieldLink.url.path | hasCharacterOtherThanSpace %}
{% if fieldButtonUrl %}
{% assign fieldUrl = promo.entity.fieldPromoLink.entity.fieldLink.url.path %}
{% elsif fieldButtonUri %}
{% assign fieldUrl = promo.entity.fieldPromoLink.entity.fieldLink.uri %}
{% endif %}
{% if fieldUrl %}
<va-link active href="{{ fieldUrl }}" text="{{ promo.entity.fieldPromoLink.entity.fieldLink.title }}"></va-link>
{% endif %}
</h3>
<p class="vads-u-margin-bottom--2 vads-u-margin-top--1 vads-u-padding-x--2">
{{ promo.entity.fieldPromoLink.entity.fieldLinkSummary }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ const nodeCampaignLandingPage = `
... on ParagraphLinkTeaser {
fieldLink {
uri
url {
path
}
title
}
fieldLinkSummary
Expand All @@ -179,6 +182,9 @@ const nodeCampaignLandingPage = `
... on ParagraphLinkTeaser {
fieldLink {
uri
url {
path
}
title
}
fieldLinkSummary
Expand Down Expand Up @@ -257,6 +263,9 @@ const nodeCampaignLandingPage = `
fieldLink {
uri
title
url {
path
}
}
fieldLinkSummary
}
Expand Down

0 comments on commit 8fae1e3

Please sign in to comment.