Clarity

 View Only
  • 1.  V13.2 How to add a picture in Login CA PPM page ?

    Posted Feb 17, 2016 02:59 PM

    Hi everyone, i need to add a new picture in top of the Login page just like this :

    unnamed.jpg

    When i see the css code i can't find how to add a picture in this page

    .

    /* Clarity PPM Logo */

    #ppm_login_logo {

      background: url(data:image/filetype;base64, my_image_base64_string);  margin: 6px 0px 0px 15px;

      width: 50px;

      height: 50px;

    }

    this can only change the small picture beside "CA Clarity ppm".

    Please any help ?



  • 2.  Re: V13.2 How to add a picture in Login CA PPM page ?
    Best Answer

    Posted Feb 17, 2016 04:17 PM

    Go to the bottom of your theme (assuming it's derived from Default) and you should see something like the following with a couple of additions/alterations I'm highlighting:

     

     

    Changes/additions:

    1. Altered the existing padding-left value from 16px to 0px (otherwise the image is offset).

    2. Added a new #ppm_login_message_top section (there are others already in the file, that's OK to have more than one).

    3. Populated the section with a base64 encoded version of the image, and its correct width and height

     

    If you wonder how to base64 encoded your image, there are 3rd party tools with this ability (I think Fiddler can do it, and there are some web sites that will offer to do it free also).  Alternatively, I wrote a javascript 'book marklet' that lets me open an image into IE and then access the bookmark which copies the base64 string of the image to the clipboard ready to paste into the theme - a derivation of some similar work I saw in a demo/tutorial function to achieve similar:

     

    javascript:function convertImgToBase64URL(url){ var canvas = document.createElement('CANVAS'), ctx = canvas.getContext('2d'), img = new Image; img.crossOrigin = 'Anonymous'; img.onload = function(){ var dataURL; canvas.height = img.height; canvas.width = img.width; ctx.drawImage(img, 0, 0); dataURL = canvas.toDataURL('image/png'); window.clipboardData.setData('Text', dataURL.substring(22)); canvas = null; }; img.src = url; }; convertImgToBase64URL(location.href);

     

    That's all entered onto 1 line and can be used as the location/address of a bookmark.

     

    Edit: Example web site offering this service: Base64 Image Encoder

     

    End result:

     

     

    Edit: Without the full base64 encoded image, here's the text of those last 2 sections of my CSS example:

     

    /* The The login service messagage style */
    #ppm_login_message_top,#ppm_login_message_bottom{
      color: #fff;
      font-family: Arial,Helvetica,Verdana,sans-serif;
      font-size: 20px;
      font-weight: bold; 
      padding-left: 0px;
      text-wrap:normal;
    }
    #ppm_login_message_top
    {
      background: url(data:image/png;base64,iV ... ==);
      width: 356px;
      height: 120px;
    }
    

     

    I wanted to show this too, since unlike your example, mine has no additional attributes like margin: ... after the background: url attribute on the same line, but the image I provided doesn't make that obvious as it was cut short.



  • 3.  Re: V13.2 How to add a picture in Login CA PPM page ?

    Posted Feb 18, 2016 05:24 AM

    Thank you very much for your reply,

    I did exactly what you told me but I have not found in my CSS ppm_login_message_top sections so i add one, also I turned my image to base64 but it shows nothing...

    could you show me your code so i can figured out what i can do

     



  • 4.  Re: V13.2 How to add a picture in Login CA PPM page ?

    Posted Feb 18, 2016 06:23 AM

    I made a mistake, our CA PPM server is V.13.1, i test in V.13.3 and it works

    did i can make this changes in V13.1?



  • 5.  Re: V13.2 How to add a picture in Login CA PPM page ?

    Posted Feb 18, 2016 10:12 AM

    Unfortunately you would have to be on version 13.3 minimum to have this work (the system I checked on had been upgraded and wasn't 13.2 as I thought).

     

    The hooks are not in place for the login page to pick up theme changes in 13.1, sorry.



  • 6.  Re: V13.2 How to add a picture in Login CA PPM page ?

    Posted Feb 18, 2016 10:27 AM

    Thank you so much for your help



  • 7.  Re: V13.2 How to add a picture in Login CA PPM page ?

    Posted Feb 18, 2016 10:30 AM

    There are some "older" discussions around customising the login page, perhaps you might get some clues from them? You could look at ;  How to add link on login page and pick up the linked discussions from there (and there is a word document attached to that discussion too that might help)

     

    (I don't think any comments were specifically to do with images though, more customised text / messages / hyperlinks )