Skip to content

Commit

Permalink
VACMS 18501 - working correct title and custom event (#2286)
Browse files Browse the repository at this point in the history
  • Loading branch information
eselkin authored Sep 30, 2024
1 parent 82c44ca commit 1cf209d
Showing 1 changed file with 28 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,38 +1,43 @@
{% comment %}
Example data:
{
"fieldTitle":"Related links",
"fieldVaParagraphs":[...]
}
Example data:
{
"fieldTitle":"Related links",
"fieldVaParagraphs":[...]
}
{% endcomment %}
{% if paragraph != empty %}
<section data-template="paragraphs/list_of_link_teasers_facility" data-entity-id="{{ paragraph.entityId }}" class="vads-u-background-color--gray-lightest vads-u-padding--2p5">
<h2 class="vads-u-margin-top--0 vads-u-margin-bottom--2 vads-u-font-size--h3 vads-u-padding-bottom--0p5 vads-u-border-bottom--1px vads-u-border-color--gray-light">
{% if regionNickname != empty %}
Other services at {{ regionNickname }}
{% else %}
{{ paragraph.fieldTitle }}
{% endif %}
{% if regionNickname != empty %}
{% capture stringTitle %}
Other services at {{ regionNickname }}
{% endcapture %}
{% else %}
{% assign stringTitle = paragraph.fieldTitle %}
{% endif %}
<section data-template="paragraphs/list_of_link_teasers_facility" data-entity-id="{{ paragraph.entityId }}"
class="vads-u-background-color--gray-lightest vads-u-padding--2p5">
<h2
class="vads-u-margin-top--0 vads-u-margin-bottom--2 vads-u-font-size--h3 vads-u-padding-bottom--0p5 vads-u-border-bottom--1px vads-u-border-color--gray-light">
{{ stringTitle | strip }}
</h2>

<div>
<div class="usa-grid usa-grid-full">
{% assign linkTeasers = paragraph.fieldVaParagraphs %}
{% comment %}
Max number of links allowed = 8
Max number of links allowed = 8
{% endcomment %}
{% if linkTeasers.length > 8 %}
{% assign linkTeasers = linkTeasers | sliceArray: 0, 8 %}
{% endif %}

{% comment %}
If there are less than or exactly 6 links, 3 items per column
If there are more than 6 links, 4 items per column
If there are less than or exactly 6 links, 3 items per column
If there are more than 6 links, 4 items per column
{% endcomment %}
{% if linkTeasers.length > 6 %}
{% assign linkWrapperStartIndex = 5 %}
{% assign linkWrapperEndIndex = 4 %}
{% else %}
{% else %}
{% assign linkWrapperStartIndex = 4 %}
{% assign linkWrapperEndIndex = 3 %}
{% endif %}
Expand All @@ -44,15 +49,16 @@
{% assign spacing = " vads-u-margin-bottom--2" %}
{% endif %}

<va-link
class="other-services-links vads-u-display--block{{ spacing }}"
<va-link
disable-analytics
onclick="recordEvent({ event: 'nav-featured-content-link-click', 'featured-content-header': '{{ stringTitle | strip }}', 'featured-content-click-label': '{{ link.title }}' });"
class="other-services-links vads-u-display--block{{ spacing }}"
href="{{ link.url.path }}"
text="{{ link.title }}"
>
text="{{ link.title }}">
</va-link>
{% endfor %}
</div>
</div>

</section>
{% endif %}
{% endif %}

0 comments on commit 1cf209d

Please sign in to comment.