I am trying to apply a custom span.class ("span.FieldName", nothing fancy, just some bolding) to a word that is in a snippet. When I select the word and then open my Styles list, I do see styles, just not the ones in my project-specific stylesheet. I'm guessing these are the styles from Flare's default .css. However, I can't figure out how to attach my stylesheet to the snippet so that the snippet has access to my span.class.
I'm not trying to do much formatting, as I want the snippet to adopt the styles of the topics it ends up in, but this is something that would be consistent throughout the entire project.
I notice that in the Properties dialog for snippets, there is no "Stylesheet" option. Does this mean that snippets cannot be associated with stylesheets?
Can snippets have stylesheets?
Re: Can snippets have stylesheets?
When you create a snippet file (Project > Add Snippet), there is an option to specify a stylesheet at that time. If you select "(default)" instead of the named stylesheet (e.g., "Styles"), then it creates the snippet file without a stylesheet reference. (Which, to me, is inconsistent. Everywhere else in Flare, if you specify default then it uses the only available stylesheet. So that's kind of a bug.)
If you didn't specify a stylesheet at the time you created the snippet, then you can still apply it, just not through the Properties screen. Open the snippet file, then left-click on the html block in the show blocks area of the XML Editor. Select Stylesheet Links from the menu that appears. When you click on that, you get a screen where you can select the stylesheet you want to use (click the << arrows to add the stylesheet reference to the snippet file).
If you didn't specify a stylesheet at the time you created the snippet, then you can still apply it, just not through the Properties screen. Open the snippet file, then left-click on the html block in the show blocks area of the XML Editor. Select Stylesheet Links from the menu that appears. When you click on that, you get a screen where you can select the stylesheet you want to use (click the << arrows to add the stylesheet reference to the snippet file).
Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
-
KevinDAmery
- Propellus Maximus
- Posts: 1985
- Joined: Tue Jan 23, 2007 8:18 am
- Location: Darn, I knew I was around here somewhere...
Re: Can snippets have stylesheets?
I think the rationale behind having snippets default to not having a stylesheet is that normally, when it comes time to create your output the snippet will be part of a larger topic, and the topic will have a stylesheet reference. If the snippets all had their own stylesheet reference, it would be possible for different parts of the built html page to be pointing to different stylesheets. While it is perfectly legal for sections of a page to use a different styles, it does introduce the risk of inconsistent appearance in the final result--Madcap was likely attempting to minimize that risk, making it so that you had to explicitly tell each snippet to use a different stylesheet if that was what you wanted. If the default behaviour was the other way, a slip of the mouse could result in your built output looking like a ransom note
Having said that, it does present a problem when you want to reference styles in your snippets that don't appear in bog standard HTML.
FWIW, I don't normally run into this issue because I use the "other" way to make snippets: I compose the content as part of a topic, then select it and use the "make snippet" function.
Having said that, it does present a problem when you want to reference styles in your snippets that don't appear in bog standard HTML.
FWIW, I don't normally run into this issue because I use the "other" way to make snippets: I compose the content as part of a topic, then select it and use the "make snippet" function.
Until next time....

Kevin Amery
Certified MAD for Flare
Kevin Amery
Certified MAD for Flare
Re: Can snippets have stylesheets?
Ahhh.... yes, of course. Don't know why I didn't think of *that* method immediately.
I wonder why the process to associate a stylesheet is so different for a snippet than it is for a topic?
Thanks for your help (again).
Thanks for your help (again).
Tracey
-
gfevrier
- Propeller Head
- Posts: 45
- Joined: Thu Jul 30, 2009 12:10 pm
- Location: Tampa, Florida
- Contact:
Re: Can snippets have stylesheets?
Lisa,
Thank you for this! It was really helpful. I've been searching for this for hours.
Thank you for this! It was really helpful. I've been searching for this for hours.
LTinker68 wrote:When you create a snippet file (Project > Add Snippet), there is an option to specify a stylesheet at that time. If you select "(default)" instead of the named stylesheet (e.g., "Styles"), then it creates the snippet file without a stylesheet reference. (Which, to me, is inconsistent. Everywhere else in Flare, if you specify default then it uses the only available stylesheet. So that's kind of a bug.)
If you didn't specify a stylesheet at the time you created the snippet, then you can still apply it, just not through the Properties screen. Open the snippet file, then left-click on the html block in the show blocks area of the XML Editor. Select Stylesheet Links from the menu that appears. When you click on that, you get a screen where you can select the stylesheet you want to use (click the << arrows to add the stylesheet reference to the snippet file).
Gina G. Wadley, M.Ed.
Staff Information Developer
http://www.ifcatscouldwrite.com
"The most valuable of all talents is that of never using two words when one will do." -- Thomas Jefferson
Staff Information Developer
http://www.ifcatscouldwrite.com
"The most valuable of all talents is that of never using two words when one will do." -- Thomas Jefferson