Customizing the Settings panel (Guide Professional and Enterprise)

Return to top
Have more questions? Submit a request

49 Comments

  • Devan - Community Manager
    Zendesk Community Team

    Hello David Coleman,

    Glad you were able to figure this question out on your own! Sound's like a boom moment indeed, but if you ever have any more questions on Guide customizations, let us know, and we would be happy to assist!

    Best regards. 

    0
  • David Coleman

    I have been successful creating settings and accessing them from templating, but is it possible to access the manifest-settings from JavaScript? If so, please share an example. 

     

    Thank you.

    0
  • Simon Blouner

    To the best of my knowledge, this is not possible - I believe it's only possible to do it by importing/exporting your themes.

    If it's possible, it's probably going to be by some crazy workaround.

    If someone can present a simple solution to this from the Guide admin area, I'll buy that person a beer :-D

    0
  • Simon Celen

    Hi David,

    It's possible to add something like this f.e. to your footer.hbs:

    <script type="text/javascript">
    var foo = {{json_stringify settings.foo}};
    </script>

    You then have a global foo variable with the value of settings.foo.

     

    A more versatile approach for when you have a bunch of settings is to instead add:

    <script id="settings" type="application/json">{
    "foo": {{json_stringify settings.foo}},
    "fum": {{json_stringify settings.fum}}
    }</script>

    ... and in your JS:

    jQuery(document).ready(function($) {
    var json = $('script#settings').html();
    var settings;
    try {
    settings = JSON.parse(json);
    }
    catch (e) {
    settings = {};
    console.error('could not parse JSON in script#settings', e, json);
    }
    });

    which gets you an object with all the individual settings.

    Hope that helps!

     

    PS @Simon, not 1-upping you of course. It's just that I have a bot crawling all Support pages for the text "free beer" and the likes ;-)

    0
  • David Coleman

    Very cool and creative Simon!

     

    Thank you both for taking the time.

     

    - David

     

    0
  • Katerina Benova

    Hi,

    I'm trying to use a manifest variable in the home-page template using {{settings.category1_id}} to compare the category ID with the variable I set in the manifest.

    I've followed: https://developer.zendesk.com/apps/docs/help-center-templates/objects#settings-object

    it works fine when I have {{#is ../settings.category1_id "360001821732"}} - using a string, but it doesn't work when I use number {{#is ../settings.category1_id 360001821732}}, so it seems that comparing a value "string" with a value "number" is the problem. Any way to set the manifest variable value as an integer?

    Manifest file: 

    {
    "identifier": "category1_id",
    "type": "text",
    "description": "ID of the first category on Homepage",
    "label": "Category 1",
    "value": "360001821732"
    }

    if I try "value": 360001821732 there is a "property error" when I try to import it to Zendesk

    Here is a code from my homepage I have now (and it's working)

    {{#each categories}}
    {{#is id 360001821732}}

    (BTW {{#is id "360001821732"}} is not working)

    And here is what I'd like to have but is not working

    {{#each categories}}
    {{#is id ../settings.category1_id}}

     

     

    0
  • Simon Celen

    Hi Katerina,

    Unfortunately that's not possible because there is no "integer" setting type. The {{#is}} helper compares both values by identity, like === in Javascript instead of equality ==, and '123' !== 123 as you know.

    There currently is no solution for this as far as I know. You'll have to resort to hardcoding the ID in the template.

    0
  • Katerina Benova

    Hi Simon,

    Thank you for your fast answer.

    Too bad it is not possible. I was hoping to avoid the hard coding in the template.

    0
  • Jon Bolden

    If anyone else was going crazy wondering why a custom variable with the type:text was returning this error:

     The property '#/settings/8/variables/0' of type object did not match any of the required schemas

    Make sure your value is set to a string instead of true/false

    value: true

    produces the error but

    value: "-"

    OR

    value:"Test"

    Works! 

    The above is an unhelpful error message and could be improved upon. Also, there is no example for type:text in the documentation and that seems to be an oversight for me.

    0
  • Jehan

    I was having the same issue as bellow

    The property '#/settings/6/variables/1' of type object did not match any of the required schemas

    I was about to give up. I had read this article many times and after so many hit and trial, I figured it out when the "type" is "text" for the variable and you forget the "value" attribute, you will get this generic error.

    I was surprised the documentation didn't even have any contents about "Text Type" variable.

    This article needs improvement.

     

     

    0
  • Mark Pickard

    Is there going to support for multiline text areas in the manifest.json settings? Currently my code is:

    {

    "identifier": "top_tips_1_heading",

    "type": "text",

    "description": "Heading",

    "label": "Top Tip 1 Heading",

    "value": "How do I link my bank account to the app?"

    },

    {

    "identifier": "top_tips_1_body",

    "type": "multiline",

    "description": "Answer",

    "label": "Top Tip 1 Answer",

    "value": "Test"

    },

    I saw some articles mention "type" "multiline" so when the theme is imported the editor can enter multi line values instead of putting a sentence all in one line of a text field.

    However "multiline" does not seem to be supported I get the following error on import:

    If it doesn't match any of the required schemas how can I get it to match? We really need a multi line text area in the settings so our editors can add multi line answers to the settings of our theme. Can you tell me how to achieve this please? See the below screen as an example of us typing in a single field...

    0
  • Augusto Silva
    Zendesk Team Member

    Hey Mark Pickard,

    The screenshot of types you posted are for apps. Themes don't support multi-line right now. In this article, you can find which types of settings are available for themes.

    Specifically for your use case, we recommend using dynamic content instead, as this supports translating to multiple languages as well. :)

    0
  • Michael Eugster

    In this help article I found the option to add a text variable to the help center. How can I use it in my html templates? https://support.zendesk.com/hc/en-us/articles/115012547687-Customizing-the-Settings-panel-Guide-Professional-and-Enterprise-#variable-object

    0
  • Jupete Manitas
    Zendesk Customer Advocate

    Hi Michael,

    Thanks for writing! You may want to look into this article Using variables in CSS and HTML. It will provide you guidance on how you can use variables in CSS and variables in Curlybars in HTML. Thank you!

    0
  • Michael Eugster

    Thank you, Jupete Manitas. I already know this guide, but I was looking for an option where I can define a text variable in the settings and then using this variable in my template.

    I resolved it by using dynamic content – like this it's also translateable. But maybe there's an even better solution?

    0
  • Jupete Manitas
    Zendesk Customer Advocate

    Hi Michael,

    I'm afraid, there is no other way. Our documentation suggested using the exporting the theme or using style.css file and using curlybars expressions in HTML. Thank you!

    1
  • Augusto Silva
    Zendesk Team Member

    Hi Michael Eugster,

    If you add a setting to manifest.json by exporting the theme and making this change locally, you can then access it via {{settings.setting_identifier}}

    We have some more info in https://developer.zendesk.com/documentation/help_center/help-center-templates/objects/#settings-object

     

    1
  • Michael Eugster

    Augusto Silva Thanks for your answer – the variable was the missing piece in my case. Even though I'm not quite sure if this is the best solution (because there's not way to translate it), this should probably work (not tested yet).

    0
  • Nathan Purcell

    The ever-unhelpful "The property '#/settings/X/variables/X' of type object did not match any of the required schemas" message could still do with an update. 

    Even a note in this article or similar reminding users that the indexes start at 0 so they can narrow down the cause of the problem. 

    And giving proper detail on the requirements of fields in the JSON file. 

    For example, I ran into the error above because I had an empty string in the description of a variable. 

    0

Please sign in to leave a comment.

Powered by Zendesk