New conversation selector template

Discussion in 'Using the new Kayako' started by Phil R, Aug 30, 2016.

  1. Phil R

    Phil R Established Member

    This may or may not be sufficient for us. However, a wider gap analysis is needed first.

    Departments & User groups in V4 allows us to define who could and could not see a department for selection, regardless of which Template Group a user may be in.

    I note that Case Forms can be allocated to "Any" or a specific brand. This covers part of the problem, but is not very open to control.

    One option I was looking at would be to use User or Organization tags. Given that user groups will be migrated to be a user tag, it seemed sensible.

    However, I then looked to see if we can customise the Case Form selector when starting a new conversation. It seems that template is missing.

    So my questions are.

    1: Am I missing something? i.e. is there a template to edit covering the Case Form selector, in which I can put template logic.

    2: A little more of an advanced one. I note I could use {{current_user.tags}} in a template to partially drive the scenario I am thinking of above. E.g. limiting a case form names "Echo One" to only those that have a tag "Ech:confused:ne". However, given the tags are CSV, how could I compare that in template notation?
  2. Gary McGrath

    Gary McGrath Staff Member

    Hey Phil,

    Great question, I don't think the template for that page is published, I am raising the question internally to find out more.

    In terms of using the template code, current user wont work, that is for automation rules, not for the help center, for the help center we have an agent object and a customer one, neither of these contains tags atm, but for reference, to compare to a list, you would use this:

    {% if current_user.tags in ["tag1","tag2","tag3"] %}


    Edit, if you wish to see an easy list of everything available within a template, you can use this code here:

        {% for key, value in _context  %}
        {%if key != "_parent" %}
         {%if key != "current_user" %}
          {% if value is iterable %}
            {% for key1, value1 in value %}
                     {% if value1 is iterable %}
                    {% for key2, value2 in value1 %}
                     {% if value2 is iterable %}
                      <li>{{ key }} -> {{ key1 }} - {{key2}} - Stopped here, goes deeper</li>
                       {% else %}
                       <li>{{ key }} -> {{ key1 }} -> {{key2}} -> {{value2}}</li>
                       {% endif %}
            {% endfor %}
                       {% else %}
                       <li>{{ key }} -> {{ key1 }} -> {{value1}}</li>
                       {% endif %}
            {% endfor %}
          {% else %}
            <li>{{ key }} : {{ value }}</li>
          {% endif %}
        {% endfor %}
    That will display all the variables along with their values.
  3. Phil R

    Phil R Established Member


    Which template engine is in operation here? It looks very Jinja2 like.
  4. Gary McGrath

    Gary McGrath Staff Member

Share This Page