Body class being ignored in HTML5 output

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
CarrieAcosta
Propeller Head
Posts: 10
Joined: Fri Dec 12, 2014 7:23 am

Body class being ignored in HTML5 output

Post by CarrieAcosta »

Hi all,

Extreme newbie here...I have created an entry in my stylesheet:

body.Internal
{
background-repeat: repeat-y;
margin-bottom: 17px;
margin-left: 17px;
margin-top: 0px;
max-width: 100%;
color: #000000;
font-size: 12pt;
font-family: Calibri;
line-height: 1.30em;
background-image: url('../Images/InternalUseOnly.jpg');
padding-left: 5px;
}

When I'm viewing the topic in the XML Editor, I see the repeating graphic along the left side of the topic.

However, when I publish, I don't see the graphic (even after refreshing). When I View Source on the results, it looks like the body tag does not have the <body class="Internal"> tag.

<body>
<p class="MCWebHelpFramesetLink MCWebHelpFramesetLinkTop"><a href="../../default.htm#PandP/MenuTOC.htm">Open topic with navigation</a>
</p>
<div class="MCBreadcrumbsBox_0"><span class="MCBreadcrumbsPrefix">You are here: </span><span class="MCBreadcrumbs">WRG Internal Processes & Procedures</span>
</div>
<h1>WRG Internal Processes & Procedures</h1>
<h3>Table of Contents</h3>

Does anyone have any suggestions for me?

Thanks,

Carrie
ChoccieMuffin
Senior Propellus Maximus
Posts: 2632
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Body class being ignored in HTML5 output

Post by ChoccieMuffin »

Just checking - what MEDIUM did you include the body.internal class? It is just so easy to put it in the wrong medium, so that'd be my first port of call.

Secondly, did you actually APPLY that class to the body in your topic?

Hope that gets you started.
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
CarrieAcosta
Propeller Head
Posts: 10
Joined: Fri Dec 12, 2014 7:23 am

Re: Body class being ignored in HTML5 output

Post by CarrieAcosta »

Hi all,

I found a workaround at least - I defined an internal Master Page and set the body class to Internal in that component, then defined the internal Master page for the target. Downside is that I can't set this only for some pages in the target and not others.

Works for me for now...

Carrie
NorthEast
Master Propellus Maximus
Posts: 6365
Joined: Mon Mar 05, 2007 8:33 am

Re: Body class being ignored in HTML5 output

Post by NorthEast »

CarrieAcosta wrote:I found a workaround at least - I defined an internal Master Page and set the body class to Internal in that component, then defined the internal Master page for the target. Downside is that I can't set this only for some pages in the target and not others.
You can apply master pages to individual topics; which will also override the default master page set for the target.

See:
http://kb.madcapsoftware.com/mobile/Advanced/Content/Flare/Master_Pages/FMP1001F_-_Using_Multiple_Master_Pages_in_your_Project.htm
scap
Propeller Head
Posts: 55
Joined: Tue Jun 28, 2022 7:36 am

Re: Body class being ignored in HTML5 output

Post by scap »

Having the same problem as OP.

I've defined body, body.A and body.B in the stylesheet.

<body class="A"> is respected in the Flare editor, as is <body class="B">.

However, the HTML output reverts to <body>.

Any ideas? Really don't want to go the route of multiple master pages.
scap
Propeller Head
Posts: 55
Joined: Tue Jun 28, 2022 7:36 am

Re: Body class being ignored in HTML5 output

Post by scap »

...for context, I'm trying to apply different background images to different topics. This will not scale well going the master page route.
NorthEast
Master Propellus Maximus
Posts: 6365
Joined: Mon Mar 05, 2007 8:33 am

Re: Body class being ignored in HTML5 output

Post by NorthEast »

scap wrote: Wed Aug 09, 2023 8:30 amAny ideas? Really don't want to go the route of multiple master pages.
You could set the background image by setting the CSS class on the html tag instead.
For example, set class "imageA" in topic Properties > Topic Style class (or whichever way you prefer), and in your CSS have:

Code: Select all

html.imageA body 
{ 
   background-image: url('../images/imageA.png'); 
}
Post Reply