Hide body background in XML editor?

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
zeedrummer
Jr. Propeller Head
Posts: 3
Joined: Wed Feb 14, 2018 2:38 pm

Hide body background in XML editor?

Post by zeedrummer »

Hi all.

I'm a new(ish) Flare user and I'm looking for some help. I have a body background image defined in my CSS and the output works exactly like I want it to. However, in the XML editor it looks terrible and gets in the way of the text, tables, etc. Other than removing the body backgound image from the CSS when working in the XML and then putting it back in before the build, is there a way for me to hide that bg in the XML editor? I've scoured the help and the forum so I'm pretty sure the answer is no, I just thought I would pose the question. Thanks!
AlexFox
Sr. Propeller Head
Posts: 159
Joined: Thu Oct 19, 2017 1:56 am

Re: Hide body background in XML editor?

Post by AlexFox »

I guess in the <head> of your document you could temporarily put <style>body { background-image: none; }</style> ?

You'd need to remove this at build time though, but you may be able to tag it out in the target so you could leave it in place in the topic.
NorthEast
Master Propellus Maximus
Posts: 6363
Joined: Mon Mar 05, 2007 8:33 am

Re: Hide body background in XML editor?

Post by NorthEast »

I'd suggest;
1) Create a stylesheet (e.g. Preview.css) with something like this:

Code: Select all

@import url('your-main-stylesheet.css');

body 
{
   background-color: transparent;
}
This basically loads your current main stylesheet, then adds a bit extra CSS on the end.
* The @import needs to link to the name of your main stylesheet CSS file.
* The CSS below that is to override where you have set the background; in the example I've assumed it's set on the body.

2) Create a new target, e.g. "Preview", and set it's master stylesheet to your new stylesheet (Preview.css).

3) Set your new target as the primary target.


Now the XML editor will display topics using the primary target, which has the modified CSS to remove the background colour.

Obviously use the 'real' target for any publishing, the new target is just to make life easier using the editor.
ChoccieMuffin
Senior Propellus Maximus
Posts: 2632
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Hide body background in XML editor?

Post by ChoccieMuffin »

Dave, you're a genius, take a bow!
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
zeedrummer
Jr. Propeller Head
Posts: 3
Joined: Wed Feb 14, 2018 2:38 pm

Re: Hide body background in XML editor?

Post by zeedrummer »

Thanks Dave,

My trial period is expired (we're evaluating the tool to see if we will replace Panviva SupportPoint) so I can't try this, but it looks like it is what I need. Appreciate the pro tip!
~ Z
Post Reply