Removing the search box from index

Discussion in 'Style and design' started by iamsteve, Jul 13, 2011.

  1. iamsteve

    iamsteve Member

    I have hidden all widgets to all users that are not logged in. The only thing that remains is the login box AND the search box. Since the KB and Troubleshooter are hidden until you login I would like to hide this search box as well. Is it possible for me to do this?
  2. Gary McGrath

    Gary McGrath Kayako Staff Staff Member

    Hi there,

    If you goto Admin CP, Templates, Groups, Click on your default template. then when the new window opens up, click on templates.

    Then go into general, and then click on header.

    Search the code and find this bit

    Code:
       <form method="post" id="searchform" action="<{$_baseName}><{$_templateGroupPrefix}>/Base/Search/Index" name="SearchForm">
       <div class="searchboxcontainer">
        <div class="searchbox">
         <span class="searchbuttoncontainer">
          <a class="searchbutton" href="javascript: void(0);" onclick="$('#searchform').submit();"><span></span><{$_language[searchbutton]}></a>
         </span>
         <span class="searchinputcontainer"><input type="text" name="searchquery" class="searchquery" onclick="javascript: if ($(this).val() == '<{$_language[pleasetypeyourquestion]}>' || $(this).val() == '<{$_language[pleasetypeyourquery]}>') { $(this).val('').addClass('searchqueryactive'); }" value="<{if $_baseIndex == true}><{$_language[pleasetypeyourquestion]}><{else}><{$_language[pleasetypeyourquery]}><{/if}>" /></span>
        </div>
       </div>
       </form>
    
    and change it to this:

    Code:
    <{if $_filterKnowledgebase == true}>
                <form method="post" id="searchform" action="<{$_baseName}><{$_templateGroupPrefix}>/Base/Search/Index" name="SearchForm">
       <div class="searchboxcontainer">
        <div class="searchbox">
         <span class="searchbuttoncontainer">
          <a class="searchbutton" href="javascript: void(0);" onclick="$('#searchform').submit();"><span></span><{$_language[searchbutton]}></a>
         </span>
         <span class="searchinputcontainer"><input type="text" name="searchquery" class="searchquery" onclick="javascript: if ($(this).val() == '<{$_language[pleasetypeyourquestion]}>' || $(this).val() == '<{$_language[pleasetypeyourquery]}>') { $(this).val('').addClass('searchqueryactive'); }" value="<{if $_baseIndex == true}><{$_language[pleasetypeyourquestion]}><{else}><{$_language[pleasetypeyourquery]}><{/if}>" /></span>
        </div>
       </div>
       </form>
    <{/if}>
    
    jcorreia and Jamie Edwards like this.
  3. Jkmitche

    Jkmitche Established Member

    Damn Gary I hope you are getting some kick backs from Kayako for all the help you provide on here. ;-)
  4. Gary McGrath

    Gary McGrath Kayako Staff Staff Member

    Thanks jk, glad to help :)

    Gary
  5. jhester

    jhester New Member

    Hey Gary, you did a right thing by helping him!! I tot the person like you is not existing in this world now a day !:D
    I hope many person like you now a day!!:D


    Yeastrol
  6. Igor Kryltsov

    Igor Kryltsov Established Member

    Can you do a step by step guide how to do it? Or if you just post some hints here I will create such guide. Will help all of us a lot.
    Cheers,
    Igor
  7. Gary McGrath

    Gary McGrath Kayako Staff Staff Member

    Hi Igor,

    In the admin CP, widgets, when you go into a widget, there are a couple of tabs, on the options tab, you can select visability for "logged in users" or "guests".

    Then there is a permissions tab, where you can remove access to that widget for guests or registered users.

    Registered users effectively means "logged in users"

    Gary
  8. Igor Kryltsov

    Igor Kryltsov Established Member

    Thank you Gary.

    I have different situation on one portal I want guests to see News, Knowledgebase and New Ticket on another portal - nothing should be available until user logs in. As I understand I have to use <{if $_userIsLoggedIn == true}> inside templates as otherwise restricted portal shows widgets available for Guest on another portal. So strange that concept of Guest does not linked to portal and is global.
    When I will finish I will post Part II of 'How do we use Kayako' with all the steps I did to configure Kayako.

    However the reason I posted this question here is - looks like links in navbar are added via loop:

    <ul id="toptoolbarlinklist"><{foreach key=key item=_item from=$_widgetContainer}><{if $_item[displayinnavbar] == '1'}><li<{if $_item[isactive] == true}> class="current"<{/if}>><a class="toptoolbarlink" style="<{if $_item[defaultsmallicon] != ''}>background-image: url(<{$_item[defaultsmallicon]}>);<{/if}>" href="<{$_item[widgetlink]}>"><{$_item[defaulttitle]}></a></li><{/if}><{/foreach}></ul>

    It was interesting to see how they can be analysed individually based on <{if $_userIsLoggedIn == true}> or other condition.
    Boxes in a main area are displayed individually. So there is no problem to switch them off but prepending each block starting with smth. like <{if $_filterNews == true}> (for News) with the same <{if $_userIsLoggedIn == true}> condition.
    Hopefully, for me I just wrap this loop and I am done but it could be nice to now how (just in case and to please own curiosity) :)
    After I wrote above I realised that one can use a combination of ($_item[defaulttitle] ='News' && $_userIsLoggedIn == true)

    Also wondering if Kayako upgrades affect these template files I value so much after all the work was done. Can they be overwritten?

    BTW Strange that neither Kayako nor one of their partners saw an opportunity to create Kayako configurator - wizard like UI which can have as many as 100 steps or more but once done you have all SQL code and all files to replace and have your system just 'what you need'. Tool should allow to stop and save progress at any step and redo some steps if necessary and understand dependencies (if we answered question 10 differently - questions 20-40 are irrelevant and hidden now). May be nobody is interested because of a worry that Kayako will see it and copycat? I already spent a week building tunnels via Putty from my PC to my server to avoid proxies and figuring out template's layouts and opening multiple parts of UI many many times.
  9. Gary McGrath

    Gary McGrath Kayako Staff Staff Member

    Hi Igor,

    Before you upgrade your helpdesk next time around, goto the admin CP, templates, Import/Export and export all your templates. Then after you upgrade kayako, you can simply import them again

    Gary
  10. Igor Kryltsov

    Igor Kryltsov Established Member

    Recorded in my Kayako notebook :)
  11. sameer yakub

    sameer yakub New Member

    nice post.. thanks for sharing....!
  12. masterctrl1

    masterctrl1 Kayako Guru

    Doesn't this lose any updated features in the new templates?
  13. masterctrl1

    masterctrl1 Kayako Guru

    Never mind. I see you answered this on my main post. Thanks.
  14. 1:10 Fravewt

    1:10 Fravewt New Member

    Thanks, GaryGBM. This was a very nice solution to our quandary. Thanks for the help and keep up the good work.
  15. Jonathan Attwood

    Jonathan Attwood New Member

    Newbie alert!!

    So, having attempted the above, I lose the search box also for registered users...
  16. Igor Kryltsov

    Igor Kryltsov Established Member

    Try:
    <{if $_userIsLoggedIn == true}>
    Instead of:
    <{if $_filterKnowledgebase == true}>

    A person was asking how to show search only to those who can see Knowledgebase.
  17. Jonathan Attwood

    Jonathan Attwood New Member

    Thanks. I will take a look shortly.

    Incidentally, I could see the knowledge base once logged in but not the search box whether logged in or not...
  18. James Faw

    James Faw New Member

    Gary, I have removed the search box, widgets, and practically everything except for the login box from my helpdesk page. This is a good thing as I only want logged in users creating tickets or seeing any content for now. I'd like to resize the login widget so that it looks more presentable (since nothing else is on the page) and put up a message telling users that they need to login to create a ticket. Have any recommendations on how to accomplish these goals?

    Great information by the way! I wish more elements of kayako were visually configurable to make it easier to edit for non-coders.
  19. Gary McGrath

    Gary McGrath Kayako Staff Staff Member

    Hi James,

    The login screen is actually drawn using HTML in the header template in the admin CP, you can alter the HTML in there and move it around, restyle it etc..

    Gary
  20. joti

    joti New Member

    New to Kayako. I was able to hide both search and knowledgebase from non logged in users , but articles on the left panel is still showing. How can i hide the left panel (KB) from non logged in users? Thanks,
    joti

Share This Page