Customizing the staff client login logo: Addendum

I left something out of my post on Customizing the staff client login logo that I wanted to be sure to add: Once you’ve changed the logo you may want to change where it links to as well. By default it links to the Koha web site (or the deprecated version if your installation is an older one). We can use a little snippet of jQuery to change that link.

Using jQuery to change the URL to which the staff client logo links

$("#login h1 a").attr("href","http://www.myacpl.org");

That looks for an <a> tag inside an <h1> inside <div id="login">, which is specific enough to only catch the login form. This snippet goes inside your intranetuserjs system preference. Assuming the only thing you’ve added to intranetuserjs is the code I covered in the previous post, this would be the revised version:

$(document).ready(function(){
$("#login h1 a").attr("href","http://www.myacpl.org");
});
// ]]>

<!--
/* Custom styles here */
#login h1 a {
height:71px;
}
#login h1 {
background:url("http://www.myacpl.org/sites/all/themes/npl/logo.png") no-repeat scroll center top transparent;
}
-->
<script type="text/javascript">// <![CDATA[
// <![CDATA[

The revised version adds our new JavaScript snippet inside jQuery's standard "$(document).ready()" to be triggered upon page load.
]]>

Tags: , , ,

3 Responses to “Customizing the staff client login logo: Addendum”

  1. Arslan Farooq Says:

    Hi Owen

    I replaced the client login logo using css because I have access to the server.

    However, to change the link of logo from koha-community.org to my own link I did this:

    $(“#login h1 a”).attr(“href”,”http://www.uaar.edu.pk/”);
    $(“#login h1 a”).attr(“href”,”http://www.myacpl.org”);
    });
    // ]]>

    // <![CDATA[
    // <![CDATA[

    And it is not working.

  2. Arslan Farooq Says:

    Uh oh, ignore the duplicate lines…

  3. Arslan Farooq Says:

    Never mind. This worked:

    $(document).ready(function(){
    $(“#login h1 a”).attr(“href”,”http://www.uaar.edu.pk/”);
    });

Leave a Reply


Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported.