diff --git a/app/views/govuk_publishing_components/components/_subscription-links.html.erb b/app/views/govuk_publishing_components/components/_subscription-links.html.erb index b85a7fba5a..dd3d2d9483 100644 --- a/app/views/govuk_publishing_components/components/_subscription-links.html.erb +++ b/app/views/govuk_publishing_components/components/_subscription-links.html.erb @@ -2,28 +2,32 @@ email_signup_link ||= false email_signup_link_text ||= t("govuk_component.subscription_links.email_signup_link_text", default: "Get email alerts") email_signup_link_data_attributes ||= false + feed_link ||= false feed_link_text ||= t("govuk_component.subscription_links.feed_link_text", default: "Subscribe to feed") feed_link_box_value ||= false feed_link_data_attributes ||= {} - tracking_is_present = true if email_signup_link_data_attributes || !feed_link_data_attributes.empty? + tracking_is_present = true if email_signup_link_data_attributes || feed_link_data_attributes.any? brand ||= false brand_helper = GovukPublishingComponents::Presenters::BrandHelper.new(brand) if feed_link_box_value feed_link = "#" - feed_link_data_attributes[:controls] = "feed-reader" + feed_box_id = SecureRandom.hex(2) + feed_link_data_attributes[:controls] = "feed-reader-#{feed_box_id}" feed_link_data_attributes[:expanded] = "false" end %> <% if email_signup_link || feed_link || feed_link_box_value %> -