<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: language_variants – Variable issue Draft Status? in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/language-variants-Variable-issue-Draft-Status/m-p/1107857#M42138</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/483218"&gt;@2CUBE-Studio&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;{{ content.state }} will show you on the individual page whether the page is "DRAFT" or "PUBLISHED_OR_SCHEDULED".&lt;BR /&gt;&lt;BR /&gt;Incidentally you can dig into a lot of page info that wouldn't necessarily be in the documentation by using the Developer Info on the cog menu on each page.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="profile2022a" style="width: 100px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/71500iE96AB1F9E9E277B9/image-size/small?v=v2&amp;amp;px=200" role="button" title="profile2022a" alt="profile2022a" /&gt;&lt;/span&gt;&lt;STRONG&gt;&lt;FONT size="5"&gt;Barry Grennan&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;P&gt;&lt;A href="https://www.seoanseo.ca?utm_source=HubSpotCommunity" target="_blank" rel="nofollow noopener noreferrer"&gt;Freelance HubSpot CMS Developer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.seoanseo.ca?utm_source=HubSpotCommunity" target="_blank" rel="nofollow noopener noreferrer"&gt;Website&lt;/A&gt; | &lt;A href="https://www.seoanseo.ca/#contact?utm_source=HubSpotCommunity" target="_blank" rel="nofollow noopener noreferrer"&gt;Contact&lt;/A&gt; | &lt;A href="https://www.linkedin.com/in/barrygrennan" target="_blank" rel="nofollow noopener noreferrer"&gt;LinkedIn&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Feb 2025 10:06:12 GMT</pubDate>
    <dc:creator>BarryGrennan</dc:creator>
    <dc:date>2025-02-12T10:06:12Z</dc:date>
    <item>
      <title>language_variants – Variable issue Draft Status?</title>
      <link>https://community.hubspot.com/t5/CMS-Development/language-variants-Variable-issue-Draft-Status/m-p/1107109#M42012</link>
      <description>&lt;P class=""&gt;I’m building a &lt;SPAN class=""&gt;&lt;STRONG&gt;custom language switcher&lt;/STRONG&gt;&lt;/SPAN&gt; using the &lt;SPAN class=""&gt;language_variants('localized')&lt;/SPAN&gt; function, but I’ve run into a limitation. It seems like there’s &lt;SPAN class=""&gt;&lt;STRONG&gt;no documented way&lt;/STRONG&gt;&lt;/SPAN&gt; to check whether a localized page is a &lt;SPAN class=""&gt;&lt;STRONG&gt;draft&lt;/STRONG&gt;&lt;/SPAN&gt; or &lt;SPAN class=""&gt;&lt;STRONG&gt;published&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;STRONG&gt;Issue&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;HubSpot has great documentation, but for deep-level coding scenarios like this, there is &lt;SPAN class=""&gt;&lt;STRONG&gt;no reference&lt;/STRONG&gt;&lt;/SPAN&gt; to &lt;SPAN class=""&gt;isDraft&lt;/SPAN&gt; or any similar property for language variants.&lt;/LI&gt;&lt;LI&gt;The &lt;SPAN class=""&gt;language_variants()&lt;/SPAN&gt; function returns localized pages, but I can’t find a way to &lt;SPAN class=""&gt;&lt;STRONG&gt;filter out draft pages&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;/LI&gt;&lt;/OL&gt;&lt;PRE&gt;&amp;lt;div class="header_lag_switcher"&amp;gt;&lt;BR /&gt;{% set languages = language_variants('localized') %}&lt;BR /&gt;&amp;lt;div class="lag_switcher {{ "no-lang" if languages|length == 0 }}"&amp;gt;&lt;BR /&gt;{% set activeLanguage = languages|selectattr('isActive', true)|first %}&lt;BR /&gt;&amp;lt;ul class="hs-language-switcher" role="menu"&amp;gt;&lt;BR /&gt;{% for language in languages %}&lt;BR /&gt;&amp;lt;li class="{{ "lag__actvie" if language.languageCode|escape_attr == html_lang }}"&amp;gt;&lt;BR /&gt;&amp;lt;a&lt;BR /&gt;lang="{{ language.languageCode|escape_attr }}"&lt;BR /&gt;hreflang="{{ language.languageCode|escape_attr }}"&lt;BR /&gt;href="{{ language.localizedUrl|escape_url }}"&lt;BR /&gt;data-value="{{ language.languageDisplayName|escape_attr }}"&amp;gt;{{ language.languageCode|escape_attr }}&amp;lt;/a&amp;gt;&lt;BR /&gt;&amp;lt;/li&amp;gt;&lt;BR /&gt;{% endfor %}&lt;BR /&gt;&amp;lt;/ul&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2CUBEStudio_0-1739256196522.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/138118i39804260E93D5400/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2CUBEStudio_0-1739256196522.png" alt="2CUBEStudio_0-1739256196522.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;STRONG&gt;What I Need Help With&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Does HubSpot expose a way to check if a localized page is a draft?&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Is there any undocumented property like isDraft or another method to filter drafts from language_variants()?&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;If not, what’s the best workaround to ensure that draft pages don’t appear in the language switcher?&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Any insights would be greatly appreciated! If someone from HubSpot can confirm whether this is possible (or missing from documentation), that would be great. &lt;span class="lia-unicode-emoji" title=":rocket:"&gt;🚀&lt;/span&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Thanks in advance! &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2025 06:45:05 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/language-variants-Variable-issue-Draft-Status/m-p/1107109#M42012</guid>
      <dc:creator>2CUBE-Studio</dc:creator>
      <dc:date>2025-02-11T06:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: language_variants – Variable issue Draft Status?</title>
      <link>https://community.hubspot.com/t5/CMS-Development/language-variants-Variable-issue-Draft-Status/m-p/1107695#M42134</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/483218"&gt;@2CUBE-Studio&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt;&amp;nbsp;Thanks for posting. It's a great question. I'd like to invite some of our community members to the conversation — hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/17186"&gt;@Anton&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/90514"&gt;@pm8rsh88&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/146956"&gt;@BarryGrennan&lt;/a&gt;&amp;nbsp;have you tackled anything similar?&lt;/P&gt;
&lt;P&gt;Thank you very much for taking a look! — Jaycee&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2025 22:15:06 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/language-variants-Variable-issue-Draft-Status/m-p/1107695#M42134</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2025-02-11T22:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: language_variants – Variable issue Draft Status?</title>
      <link>https://community.hubspot.com/t5/CMS-Development/language-variants-Variable-issue-Draft-Status/m-p/1107857#M42138</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/483218"&gt;@2CUBE-Studio&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;{{ content.state }} will show you on the individual page whether the page is "DRAFT" or "PUBLISHED_OR_SCHEDULED".&lt;BR /&gt;&lt;BR /&gt;Incidentally you can dig into a lot of page info that wouldn't necessarily be in the documentation by using the Developer Info on the cog menu on each page.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="profile2022a" style="width: 100px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/71500iE96AB1F9E9E277B9/image-size/small?v=v2&amp;amp;px=200" role="button" title="profile2022a" alt="profile2022a" /&gt;&lt;/span&gt;&lt;STRONG&gt;&lt;FONT size="5"&gt;Barry Grennan&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;P&gt;&lt;A href="https://www.seoanseo.ca?utm_source=HubSpotCommunity" target="_blank" rel="nofollow noopener noreferrer"&gt;Freelance HubSpot CMS Developer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.seoanseo.ca?utm_source=HubSpotCommunity" target="_blank" rel="nofollow noopener noreferrer"&gt;Website&lt;/A&gt; | &lt;A href="https://www.seoanseo.ca/#contact?utm_source=HubSpotCommunity" target="_blank" rel="nofollow noopener noreferrer"&gt;Contact&lt;/A&gt; | &lt;A href="https://www.linkedin.com/in/barrygrennan" target="_blank" rel="nofollow noopener noreferrer"&gt;LinkedIn&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 10:06:12 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/language-variants-Variable-issue-Draft-Status/m-p/1107857#M42138</guid>
      <dc:creator>BarryGrennan</dc:creator>
      <dc:date>2025-02-12T10:06:12Z</dc:date>
    </item>
  </channel>
</rss>

