1. Kayako Download customers: we will continue to develop and support Kayako Download beyond July 2017, alongside the new Kayako for existing customers.

    Find out more.

  2. The forum you are viewing relates to Kayako Classic. If you signed up or upgraded to the new Kayako (after the 4th July 2016), the information in this thread may not apply to you. You can visit the forums for the new Kayako here.

Assign custom field group to template group

Discussion in 'Style and design' started by Jeremiah Cich, Apr 27, 2016.

  1. Jeremiah Cich

    Jeremiah Cich New Member

    I have a multi-branded site that i want to assign a custom field group to a template group.
    I believe i have to alter the Template customfields of Template group "A" to add the following
    <{if _templateGroupPrefix == '/test’} and $_customFieldGroup[title] == “my custom group">

    1. is this the right code
    2. does this need to be added to each template group's customfields
    3. where does this need to belong in the code?
     
  2. Gary McGrath

    Gary McGrath Staff Member

    Hi there!

    That code looks about right, but obviously /test will need to be /NameofTemplateGroup.

    Also, if you want "all field groups" to display apart from 1, then you will want to reverse the logic, and use != rather than ==

    You will need this code edit in all the customfields templates from every group to ensure that specific field group only displays when you want it to

    The code would go pretty much at the top of the template code

    e.g. right at the top is

    Code:
    
    <table class="hlineheader"><tr><th rowspan="2" nowrap><{$_customFieldGroup[title]}></th><td>&nbsp;</td></tr><tr><td class="hlinelower">&nbsp;</td></tr></table>
    
    
    You would add it just above that, but below the foreach line.

    You will then also need to add an <{/if}> to close the check, you would add that pretty much right at the bottom, Just above the very last <{/foreach}>

    Gary
     
  3. Jeremiah Cich

    Jeremiah Cich New Member

    I am sorry for my lack of knowledge when it comes to code architecture.
    I followed your directions. here is the line i used
    <{if _templateGroupPrefix == '/Astro’} and $_customFieldGroup[title] == “Astro Unit Information">
    with the <{/if}> above the very last line <{/foreach}>

    i received the following error
    Uncaught Exception
    Compilation error at line 68 in "string:" : Syntax malformation, a block of type "if" was closed but was not opened in ./__swift/thirdparty/dwoo/Dwoo/Compiler.php:979
     
  4. Gary McGrath

    Gary McGrath Staff Member

    Hi there,

    That means the /if was put in the wrong place. Where you working with Michael from support on this problem by chance? I showed him how to do it, so he cant hopefully remote onto your system and get it sorted out for you.

    Gary
     
  5. niamh

    niamh New Member

    @@@@@@@@@@@@@@@@
     

Share This Page