KB User's Guide - API - Site Styles

This document provides information in the Site Styles API for the KnowledgeBase.

Title

Get Site Styles

Calls externally-published site styles for a specified site domain

Collection Endpoint

This API does not have an collection response.

Entity Endpoint

/api/v1/site-styles/[siteId]

Example: https://kb.wisc.edu/api/v1/site-styles/2

** You can find your siteId by reviewing the URI Components in the Group Spaces API. Please review KB User's Guide - API - Group Spaces for details. Your siteId will be listed as an integer in the extSiteId URI Component.

Entity Sample Response

{
"siteId": "82",
"styleFilePath": "/images/group251/shared/css/uw-theme-kb-v4.css",
"styleContent": "#top-links, #top-links-int {\r\n\r\n background-color: #6385B1;\r\n\r\n}\r\n \r\n#group-logo img {\r\n\r\n width: 0px;\r\n height: px;\r\n margin: 0;\r\n\r\n}\r\n\r\n\r\n#search-form .search {\r\n\r\n background: #6385B1; \r\n\r\n}\r\n\r\n#group-logo .group-name-hide {\r\n\r\n color: #6385B1;\r\n \r\n\r\n}\r\n\r\ndiv.code {\r\n display: inline-block;\r\n background: #f1f1f1;\r\n margin: 1em;\r\n padding: .5em 1em;\r\n}\r\n\r\nimg.fr-bordered {\r\n border: 1px solid #ccc;\r\n}\r\n\r\n#copyright {\r\n\r\n border-top: 5px solid #6385B1;\r\n font-weight: bold;\r\n \r\n}\r\n\r\n.kbleftlinks, .kbrightlinks, #qcats {\r\n\r\n \r\n border-bottom: 4px solid #6385B1;\r\n\r\n\r\n}\r\n\r\n.kbleftlinks a::after, .kbrightlinks a::after {\r\n\r\n \r\n background-image: url('');\r\n \r\n\r\n}\r\n\r\n.feedback-btn-link[href*='help=listener'] {\r\n\r\ndisplay: none;\r\n}",
"styleContent1": "#top-links {background-color:#6385B1; color:#ffffff;}\r\n#logo-search {background-color:#6385B1; color:#ffffff;}\r\n\r\n#search-form .inputBox {\r\n font-size: 16px;\r\n}\r\n\r\nbody {\r\n background-color: #eeebe4;\r\n background-image: none;\r\n background-repeat: repeat-x;\r\n color: #333333;\r\n font-family: Arial,Helvetica,sans-serif;\r\n font-size: small;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n\r\n#body-container {\r\n margin-left: auto;\r\n margin-right: auto;\r\n width: 1060px;\r\n}\r\n\r\n#search-form .search {\r\n font-family: arial,verdana,sans-serif;\r\n font-size: 16px;\r\n font-weight: bold;\r\n}\r\n\r\n\r\n#search-form a.advanced {\r\n border: 1px solid #ffffff;\r\n color: #ffffff;\r\n font-size: 11px;\r\n padding: 1px 6px 2px;\r\n text-decoration: none;\r\n}\r\n\r\n#page-content {\r\n background-color: #ffffff;\r\n margin-top: 7px;\r\n padding: 11px;\r\n}\r\n\r\n#news, #topDocs, #recentDocs, .custom {\r\n background-color: #ffffff;\r\n margin: 8px;\r\n margin-left: 4px;\r\n margin-bottom: 9px;\r\n}\r\n\r\n#news h2, #topDocs h2, #recentDocs h2, .custom h2 {\r\n text-align: left;\r\n font-size: 14px;\r\n line-height: 20px;\r\n font-weight: bold;\r\n font-family: verdana,arial;\r\n margin: 0px;\r\n padding: 0px 10px;\r\n}\r\n\r\n\r\n.topic-path a {\r\n color: #000000;\r\n text-decoration: none;\r\n}\r\n\r\n.topic-path {\r\n color: #000000;\r\n font-size: 0.9em;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n\r\n.kbleftlinks .head, .kbrightlinks .head, #qlinks .head, #resource-links .head, #qcats .head, #news h2, #topDocs h2, #recentDocs h2, .custom h2 {background-color:#dddddd; color:#333333;}\r\n.kbleftlinks ul, .kbrightlinks ul, #qlinks ul, #resource-links ul {border-left-color:#dddddd; border-right-color:#dddddd; border-bottom-color:#dddddd;color:#333333;}\r\n.kbleftlinks li, .kbrightlinks li, #qlinks li, #resource-links li {border-bottom-color:#dddddd;color:#333333;}\r\n\r\n#search-result-table1 th {background-color: #dddddd;}\r\n\r\n#logo-search {\r\n background-color: #6385b1;\r\n box-shadow: 0 0 0 rgba(0, 0, 0, 0);\r\n margin: 0;\r\n padding: 0;\r\n}\r\n\r\n#top-left-links li, #top-right-links li {\r\n font-size: 14px;\r\n line-height: 14px;\r\n font-weight: bold;\r\n}\r\n\r\n\r\n#container {\r\n background: rgba(0, 0, 0, 0) linear-gradient(#ffffff, #ffffff, #ffffff) repeat scroll 0 0;\r\n box-shadow: 0 0 0 rgba(0, 0, 0, 0.0);\r\n min-width: 500px;\r\n position: relative;\r\n width: 100%;\r\n}\r\n\r\n\r\n\r\nr {color:#2B1600;}\r\na {color: #000099; text-decoration:underline;}\r\n#news a, #topDocs a, #recentDocs a, .custom a {color: #000099;}\r\n.kbleftlinks a, .kbrightlinks a, #qlinks a, #resource-links a, #qcats a {color: #000099;}\r\n\r\n\r\n#copyright {width:100%; margin-top:8px; border-top:2px solid #6385B1;}\r\n#copyright {\r\n background: #6385b1 none repeat scroll 0 0;\r\n color: #ffffff;\r\n}\r\n\r\n#copyright a {\r\n background-color: inherit;\r\n color: #ffffff;\r\n text-decoration: none;\r\n}\r\n#search-form form a.advanced:hover {color:#000; text-decoration:none;}\r\n.yes_match{color:#000000}\r\n.no_match{color:#000000}",
"styleContent2": "#top-links, #top-links-int {\r\n\r\n background-color: #6385B1;\r\n\r\n}\r\n \r\n#group-logo img {\r\n\r\n width: 0px;\r\n height: px;\r\n margin: 0;\r\n\r\n}\r\n\r\n\r\n#search-form .search {\r\n\r\n background: #6385B1; \r\n\r\n}\r\n\r\n#group-logo .group-name-hide {\r\n\r\n color: #6385B1;\r\n \r\n\r\n}\r\n\r\ndiv.code {\r\n display: inline-block;\r\n background: #f1f1f1;\r\n margin: 1em;\r\n padding: .5em 1em;\r\n}\r\n\r\nimg.fr-bordered {\r\n border: 1px solid #ccc;\r\n}\r\n\r\n#copyright {\r\n\r\n border-top: 5px solid #6385B1;\r\n font-weight: bold;\r\n \r\n}\r\n\r\n.kbleftlinks, .kbrightlinks, #qcats {\r\n\r\n \r\n border-bottom: 4px solid #6385B1;\r\n\r\n\r\n}\r\n\r\n.kbleftlinks a::after, .kbrightlinks a::after {\r\n\r\n \r\n background-image: url('');\r\n \r\n\r\n}\r\n\r\n.feedback-btn-link[href*='help=listener'] {\r\n\r\ndisplay: none;\r\n}",
"styleContent3": "",
"styleContent4": "",
"styleEnabledNum": "2",
"_links": {
"self": {
"href": "https://kb.wisc.edu/api/v1/site-styles/82"
}
}
}

Note: There are four distinct custom CSS fields for each live site. Only one of the four fields may be active and applied to your site.

The custom styles are applied on top of the base layout being used for your site. You can check which base layout is set in the KB Admin Tools under SitePref > FullView Layout/CSS)

Success Response

Code: 200 OK
Content: Content-type: application/hal+json

Error Response

Code: 404 Page Not Found
Content: { error : "Page not found." }

OR

Code: 405 Method Not Allowed
Content: { error : None }

Notes