adding a text header to the lefthand sidebar menu

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
LisaLiel
Propeller Head
Posts: 16
Joined: Mon Dec 02, 2024 6:32 am

adding a text header to the lefthand sidebar menu

Post by LisaLiel »

Is there any way for me to add text above the menu in the sidebar in HTML? I don't want to add it in the top header, because it will make the top header too tall and reduce the reading area. But I have several documents with a standard top header, and I'd like to put the name of the product above the menu.
Psider
Propellus Maximus
Posts: 879
Joined: Wed Jul 06, 2011 1:32 am

Re: adding a text header to the lefthand sidebar menu

Post by Psider »

Is it SideNav? I don't think there's any way in the skin editor, but you could potentially use CSS to insert text before the actual TOC code.

I tried this in a test project, so perhaps try in a copy of your project to see if it will work.

I used the browser developer tools to find the relevant output code for the sidebar. Then I added the following to the end of the stylesheet:

.sidenav-container > ul:first-child:before {
content: "My Amazing App";
color: pink;
font-size: xx-large;
}

This code targets the UL that is the first tag inside the sidenav containing and inserts the text "My Amazing App" in front of it. It also colours it pink and makes the font xx large.

It looks like this after generation:
content before.png
You'd just put it in your main style sheet if you were generating from separate projects.

If you're generating multiple output from one project, you'll probably need to create a separate stylesheet for each HTML output (to use in the relevant target) that imports the main stylesheet, and includes the above css with the appropriate product name.

Like so:

@import (url: 'mymainstyles.css');
.sidenav-container > ul:first-child:before {
content: "My Amazing App";
color: pink;
font-size: xx-large;
}
You do not have the required permissions to view the files attached to this post.
LisaLiel
Propeller Head
Posts: 16
Joined: Mon Dec 02, 2024 6:32 am

Re: adding a text header to the lefthand sidebar menu

Post by LisaLiel »

Thanks. I'll give that a try.
Post Reply