Add portal title into Navbar in Service Portal Helsinki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2016 05:28 PM
Hi, I'm looking to add a site title next to our logo within the ServicePortal, using Helsinki version.
Any ideas would be most appreciated.
Thanks
Ed
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2017 11:59 PM
Hi Ed,
Actually there is a sneaky way to do it without modifying any widget or code: CSS that creates a dynamic sized title so it supports mobile also.
Steps:
Add the following CSS to the theme that the portal is using. You may have to create a new theme so it is not shared by other portals.
a.navbar-brand.navbar-brand-logo.ng-scope::after {
margin-left: 222px;
position: fixed;
top: 23px;
font-size: 1.9em;
font-size: calc(7px + 2vw);
content: "Enterprise Portal";
}
a.navbar-brand.navbar-brand-logo.ng-scope {
width: calc( 200px + 20vw);
}
What's going on here:
- It's adding a "Enterprise Portal" to the right of the logo but still inside the clickable "a" tag so it behaves as a hyperlink.
- In my case the logo is 200px wide, so margin-left leaves 22px buffer to the right
- the first font-size is for broswers that don't support the clever stuff
- the second font-size is saying that the size of a single character should be 2% of the browser width (2vw) + an addition 7px. This prevents the font from getting smaller than 7px on small screens.
- width tag is to make sure things wrap properly around the floating text by resize the a tag to be thewidth of the logo (200px) plus the variable with of the text (20vw for my text but would vary depending on the number of characters in the title)
Obviously you can't tweak all the sizes here and add colour or fonts, but you get the idea.
This has no impact on upgrades since no widget or code was modified to get the title in place.
Hope this answers your question.
Note you could extend this solution with media queries to prevent the font getting to big or to place the text under the logo on small screens.
Cheers,
Howard.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2017 06:31 PM
Just to flesh out my previous answer, the CSS below with prevent the title's font from growing any further, once the screen width hits 1920, and will move the title under the logo on small screens (bumping the logo up a bit so it fits on the 60px header bar).
@media all and (min-width: 1000px) {
a.navbar-brand.navbar-brand-logo.ng-scope::after {
margin-left: 222px;
position: fixed;
top: 23px;
font-size: 1.9em;
font-size: 2vw;
content: "Enterprise Portal";
}
a.navbar-brand.navbar-brand-logo.ng-scope {
width: calc( 200px + 20vw);
}
}
@media all and (min-width: 1920px) {
a.navbar-brand.navbar-brand-logo.ng-scope::after
font-size: 1.9em;
}
}
@media all and (max-width: 1000px) {
a.navbar-brand.navbar-brand-logo.ng-scope::after {
margin-left: 14px;
position: fixed;
top: 41px;
font-size: 1em;
content: "Enterprise Portal";
}
a.navbar-brand.navbar-brand-logo.ng-scope {
padding-bottom: 18px;
}
}
cheers,
Howard Elton