Cognos Analytics

 View Only
Expand all | Collapse all

Changing the size of the tiles in 11.2

  • 1.  Changing the size of the tiles in 11.2

    Posted Wed August 10, 2022 06:59 AM
    How can we make the tiles smaller than the standard out of the box sizes?

    ------------------------------
    Vic Nicholls
    ------------------------------

    #CognosAnalyticswithWatson


  • 2.  RE: Changing the size of the tiles in 11.2

    IBM Champion
    Posted Thu August 11, 2022 05:20 AM
      |   view attached
    You'll need to make an extension for this, but you can use this extension to modify whatever other styles you need at the same time. The extension will be your custom styles, so let's call it that.

    Start by making a new folder, call it myStyles, and add a new text document called spec.json with following:

    {
      "name": "myStyles",
      "schemaVersion": "1.0",
      "extensions": [
        {
          "features": [{"id":"myStyles",
            "cssStyles": ["v1/ext/myStyles/styles.css"]
          }],
          "perspective": "common"
        }
        
      ]
    }​

    In the same folder make a new text document called styles.css with the following

    .ba-tile{
      height:160px !important; 
      border-radius: 25px;
      box-shadow: 5px 10px 8px #888888;
      width: 95%;
    }
    
    

    At the moment the folder only needs those two items, but you can obviously add as many additional items (images, css, css libraries) as you need.

    Zip up the folder, and upload it as an extension to Cognos:

    Reload the page and gasp in astonishment as it suddenly looks a million times better:



    I've attached the extension so you can use that as a base.



    ------------------------------
    Paul Mendelson
    ------------------------------

    Attachment(s)

    zip
    myStyles.zip   691 B 1 version


  • 3.  RE: Changing the size of the tiles in 11.2

    Posted Thu August 11, 2022 05:42 AM
    Thank you so much! I will give this a try.

    ------------------------------
    Vic Nicholls
    ------------------------------



  • 4.  RE: Changing the size of the tiles in 11.2

    Posted Thu August 11, 2022 05:47 AM
    Edited by System Fri January 20, 2023 04:21 PM
    Ok a few questions. I understand the height change, but the border radius is the actual length or is the width that? The box shadow just makes it look a bit better.

    Also why is it just .ba-tile? Everything else has the longer names. 

    Thanks, 

    ------------------------------
    Vic Nicholls
    ------------------------------



  • 5.  RE: Changing the size of the tiles in 11.2

    IBM Champion
    Posted Thu August 11, 2022 08:52 AM
    Think of border-radius as a quarter of a circle. At 0px each corner would be a left angle. At 90px each corner would be completely curved. If you have a square element on the page, border radius 90 would make it a circle (90*4=360).

    I just picked ba-tile as it was a convenient class that matched all of the tiles on the screen.

    ------------------------------
    Paul Mendelson
    ------------------------------



  • 6.  RE: Changing the size of the tiles in 11.2

    Posted Thu August 11, 2022 06:25 AM
    @Paul Mendelson  One problem - this changes the tiles on the tab, not the quick launch tiles. Is there a way to make those smaller? ​

    ------------------------------
    Vic Nicholls
    ------------------------------



  • 7.  RE: Changing the size of the tiles in 11.2

    IBM Champion
    Posted Thu August 11, 2022 08:47 AM
    Sure, I wasn't sure which tiles you wanted. 

    Best way to do this is to use the browser developer toolbar to get the class names in the elements you need to modify.

    For the quick launch tiles setting the height won't actually work. One of the divs has a ridiculous margin-top making it take a lot of room:



    What you could do in the styles.css just set:
    .ca-home-quickLaunchTile_title {
        margin-top: 10px !important;
    }​



    ------------------------------
    Paul Mendelson
    ------------------------------



  • 8.  RE: Changing the size of the tiles in 11.2

    Posted Fri August 12, 2022 06:20 AM
    Thank you so much for that explanation!!

    ------------------------------
    Vic Nicholls
    ------------------------------



  • 9.  RE: Changing the size of the tiles in 11.2

    Posted Mon August 15, 2022 05:35 AM
    Ok I tried this and it doesn't work. I was finally able to get to see what you had for a screen shot because I thought I might need to look at something else. I don't see a lot I could change.

    ------------------------------
    Vic Nicholls
    ------------------------------