<?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: Can't add visibility condition on theme field in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Can-t-add-visibility-condition-on-theme-field/m-p/664289#M29464</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/250023"&gt;@Oezcan&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for taking the time to answer, I'll try that this morning and will mark this a solution if it works !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I still think this should be present in the themes documentation and I hope they're going to fill the gap soon, this can be very important for building a user friendly theme settings interface and avoid confusion.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Ludwig&lt;/P&gt;</description>
    <pubDate>Wed, 13 Jul 2022 08:49:55 GMT</pubDate>
    <dc:creator>LMeert</dc:creator>
    <dc:date>2022-07-13T08:49:55Z</dc:date>
    <item>
      <title>Can't add visibility condition on theme field</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Can-t-add-visibility-condition-on-theme-field/m-p/662697#M29394</link>
      <description>&lt;P&gt;Good morning !&lt;BR /&gt;&lt;BR /&gt;As said in title, I'm trying to conditionnally display fields in the theme settings, the same way we'd set up a conditionnal field on modules via the interface.&lt;BR /&gt;&lt;BR /&gt;I've had a look at the code generated by setting up a condition on a module and tried to reproduce on the theme fields.json file, but the interface is giving me an error I can't find my way around.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basically I want to give users a way to choose whether they will be using a google font or a custom font from the theme settings (as currently, the themes don't natively support picking a custom font from the theme settings, this is part of a workaround).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LMeert_0-1657531304142.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/70254i23F5560484D1358F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LMeert_0-1657531304142.png" alt="LMeert_0-1657531304142.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I've created a picker, which works fine, to let the user pick from custom fonts and google fonts.&lt;BR /&gt;&lt;BR /&gt;I've got two font fields, primary and secondary, and I simply want to make them visible in the settings if the font_type selected is "google".&lt;BR /&gt;The "visibility" code for both fields seems to have the right structure, but it won't accept any value for the "controlling_field".&lt;BR /&gt;&lt;BR /&gt;I've tried to add the relative field path (font_type) or the full path (theme.global_fonts.font_type) but I can't publish, it's giving me an error :&amp;nbsp;&lt;/P&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;&lt;STRONG&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt;Error:null: no controlling_field with id 'theme.global_fonts.font_type' exists&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;
&lt;DIV class=""&gt;or
&lt;DIV class=""&gt;&lt;STRONG&gt;&lt;STRONG&gt;Error:null: no controlling_field with id 'font_type' exists&lt;/STRONG&gt;&lt;/STRONG&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;&amp;nbsp;
&lt;DIV class=""&gt;I've tried adding them with or without quotes also =&amp;gt; not working...
&lt;DIV class=""&gt;&amp;nbsp;
&lt;DIV class=""&gt;Any help would be much appreciated !
&lt;DIV class=""&gt;&amp;nbsp;
&lt;DIV class=""&gt;Thanks,&lt;BR /&gt;Ludwig&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 11 Jul 2022 09:21:56 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Can-t-add-visibility-condition-on-theme-field/m-p/662697#M29394</guid>
      <dc:creator>LMeert</dc:creator>
      <dc:date>2022-07-11T09:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: Can't add visibility condition on theme field</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Can-t-add-visibility-condition-on-theme-field/m-p/662906#M29401</link>
      <description>&lt;P&gt;Hey,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/257487"&gt;@LMeert&lt;/a&gt;! Thanks for the interesting question &lt;span class="lia-unicode-emoji" title=":light_bulb:"&gt;💡&lt;/span&gt; —&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/61659"&gt;@Stephanie-OG&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/127598"&gt;@Sjardo&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/250023"&gt;@Oezcan&lt;/a&gt;,&amp;nbsp;do you have any insight into what else&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/257487"&gt;@LMeert&lt;/a&gt;&amp;nbsp;can try here?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much! — Jaycee&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 16:05:08 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Can-t-add-visibility-condition-on-theme-field/m-p/662906#M29401</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2022-07-12T16:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can't add visibility condition on theme field</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Can-t-add-visibility-condition-on-theme-field/m-p/663350#M29424</link>
      <description>&lt;P&gt;I am also trying to have this feature. Following your post.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 03:05:19 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Can-t-add-visibility-condition-on-theme-field/m-p/663350#M29424</guid>
      <dc:creator>tiennguyenvan</dc:creator>
      <dc:date>2022-07-12T03:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can't add visibility condition on theme field</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Can-t-add-visibility-condition-on-theme-field/m-p/663605#M29434</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/257487"&gt;@LMeert&lt;/a&gt;,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/415161"&gt;@tiennguyenvan&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074"&gt;@Jaycee_Lewis&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I had the same problem once and it really took me a while to understand that it's about a new key. So you have to write a new key, like "id" in this case. And then add a value to this, e.g. 1 and connect it to the others eg: "controlling_field": 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The whole thing would look like this, for example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;[
  {
    "name": "field_group",
    "label": "field_group",
    "required": false,
    "locked": false,
    "type": "group",
    "children": [
      { "id": 1,
        "name": "choice_field",
        "label": "Choice field",
        "required": false,
        "locked": false,
        "display": "select",
        "inline_help_text": "",
        "help_text": "",
        "type": "choice",
        "placeholder": "",
        "default": null,
        "choices": [
          ["value 1", "Label 1"],
          ["value 2", "Label 2"]
        ]
      },
      {
        "name": "font_field",
        "label": "font_field",
        "required": false,
        "locked": false,
        "inline_help_text": "",
        "help_text": "",
        "load_external_fonts": true,
        "type": "font",
        "default": {
          "size": 12,
          "font": "Merriweather",
          "font_set": "GOOGLE",
          "size_unit": "px",
          "color": "#000",
          "styles": {}
        },
        "visibility": {
          "controlling_field": 1,
          "operator": "equal",
          "controlling_value_regex": "value 1"
        }
      },
      {
        "name": "color_field",
        "label": "Color field",
        "required": false,
        "locked": false,
        "inline_help_text": "",
        "help_text": "",
        "type": "color",
        "default": {
          "color": "#ffffff",
          "opacity": 100
        },
        "visibility": {
          "controlling_field": 1,
          "operator": "equal",
          "controlling_value_regex": "value 2"
        }
      }
    ]
  }
]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe there is another solution, but this is how it worked for me.&lt;/P&gt;
&lt;P&gt;I hope I could help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Özcan&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 12:41:19 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Can-t-add-visibility-condition-on-theme-field/m-p/663605#M29434</guid>
      <dc:creator>Oezcan</dc:creator>
      <dc:date>2022-07-12T12:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can't add visibility condition on theme field</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Can-t-add-visibility-condition-on-theme-field/m-p/664289#M29464</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/250023"&gt;@Oezcan&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for taking the time to answer, I'll try that this morning and will mark this a solution if it works !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I still think this should be present in the themes documentation and I hope they're going to fill the gap soon, this can be very important for building a user friendly theme settings interface and avoid confusion.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Ludwig&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 08:49:55 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Can-t-add-visibility-condition-on-theme-field/m-p/664289#M29464</guid>
      <dc:creator>LMeert</dc:creator>
      <dc:date>2022-07-13T08:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: Can't add visibility condition on theme field</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Can-t-add-visibility-condition-on-theme-field/m-p/664878#M29492</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/250023"&gt;@Oezcan&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":raising_hands:"&gt;🙌&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 00:02:55 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Can-t-add-visibility-condition-on-theme-field/m-p/664878#M29492</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2022-07-14T00:02:55Z</dc:date>
    </item>
  </channel>
</rss>

