Styles applied to snippets aren't displaying in PDF or HTML5

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
jp_from_fiserv
Jr. Propeller Head
Posts: 6
Joined: Wed Sep 19, 2012 12:08 pm
Location: New Jersey, USA

Styles applied to snippets aren't displaying in PDF or HTML5

Post by jp_from_fiserv »

Hi, folks!

I'm trying to help out my team's editors and simplify the review process a bit. So, in copy we're submitting to our editors, I'm trying to use styles to mark snippets so that the editors know they may have already seen and given feedback on a particular bit of reused text.

To that end, I've set up the following styles:

Code: Select all

MadCap|snippetBlock.flagged
{
	border: 1px green solid;
	background-color: #c9ffd2;
}

MadCap|snippetBlock.flagged::before
{
	content: "This is a snippet; consider whether you have reviewed this text before";
	font-size: 50%;
	letter-spacing: .1em;
	word-spacing: .1em;
	text-color: #016011;
	font-style: italic;
}

MadCap|snippetText.flagged
{
	border: 1px green solid;
	background-color: #c9ffd2;
}

MadCap|snippetText.flagged::before
{
	content: "Snippet Text:";
	font-style: italic;
	font-size: 60%;
	background-color: #c9ffd2;
	text-color: #016011;
	vertical-align: top;
}

All of these test out just fine when I had them set up as Div and Span styles, so I know Flare supports the ::before pseudoclass.

but when in my file I include the snippets and use the class:

Code: Select all

<MadCap:snippetBlock src="Resources/MySnippet.flsnp" class="flagged" />
 <p>This is a sentence I want to include some <MadCap:snippetText src="Resources/MySnippet.flsnp" class="flagged" /> into. It uses the snippetText.flagged style.</p>
Absolutely nothing displays in the output. It all displays as intended in the XML Editor...
preview shows styles.gif
...but PDF and HTML5, both preview and output, display as plain text.
snippets no styles showing.gif
I've also tried removing the classes so that all snippets use the classes, but no luck there either.

Is this just something Flare doesn't support, and I should stop trying to find something wrong in what I'm doing? Or am I doing something wrong? I can go back to the divs and spans, but I'm trying to roll this out across a broad userbase with varying levels of expertise and comfort, and I really want to make it as simple as possible.

Thanks for any help you can offer!
You do not have the required permissions to view the files attached to this post.
NorthEast
Master Propellus Maximus
Posts: 6365
Joined: Mon Mar 05, 2007 8:33 am

Re: Styles applied to snippets aren't displaying in PDF or H

Post by NorthEast »

jp_from_fiserv wrote:Is this just something Flare doesn't support, and I should stop trying to find something wrong in what I'm doing?
Unfortunately, you won't be able to do this with Flare. If you inspect the HTML code in the output, you'll see that the <MadCap:snippetBlock ..> tags are replaced by the content inside the snippet. There is no 'container' tag that encloses the snippet.

All <MadCap: ..> tags are replaced in the output with generated HTML code. Only some will persist the attributes on the MadCap tag, e.g. if you set a class for <MadCap:xref >.
jp_from_fiserv
Jr. Propeller Head
Posts: 6
Joined: Wed Sep 19, 2012 12:08 pm
Location: New Jersey, USA

Re: Styles applied to snippets aren't displaying in PDF or H

Post by jp_from_fiserv »

That's good (if disappointing) information, thank you.

Is there a list somewhere of the MadCap elements that survive the outputting process?
Flare 2018, Windows 7
NorthEast
Master Propellus Maximus
Posts: 6365
Joined: Mon Mar 05, 2007 8:33 am

Re: Styles applied to snippets aren't displaying in PDF or H

Post by NorthEast »

jp_from_fiserv wrote:That's good (if disappointing) information, thank you.

Is there a list somewhere of the MadCap elements that survive the outputting process?
Unfortunately not.

A good rule of thumb is to check what you can apply via the Flare interface. For example:
* For attributes, when you insert a cross-reference you can choose a class attribute for the xref; which tells you the class will be carried through to output.
* For the stylesheet editor, you can show Assorted Relevant Properites; which usually means that property is supported for that tag.
jp_from_fiserv
Jr. Propeller Head
Posts: 6
Joined: Wed Sep 19, 2012 12:08 pm
Location: New Jersey, USA

Re: Styles applied to snippets aren't displaying in PDF or H

Post by jp_from_fiserv »

OK, thank you.

I *think* I solved this by including divs and spans in a snippet template, and then using two stylesheets, one with only editorial formatting. And then I condition the editorial stylesheet out of the final build. We'll see if it's acceptable to users...

Thanks for your help!
Flare 2018, Windows 7
AlexFox
Sr. Propeller Head
Posts: 162
Joined: Thu Oct 19, 2017 1:56 am

Re: Styles applied to snippets aren't displaying in PDF or H

Post by AlexFox »

Conditioning a stylesheet out of the build process seems a little overkill. Is there any reason you can't put something like the following as your snippet content?

Code: Select all

<div class="snippet-flagged" MadCap:conditions="Snippet.Flagged" MadCap:excludeAction="unbind">
SNIPPET CONTENT
</div>
In this example, excluding the Snippet.Flagged condition in your target will unbind the classes on the div block, leaving the text intact. You can do the same thing in-line with a span.
Post Reply