7 Replies Latest reply on Apr 28, 2008 9:12 AM by Peter Grainge

    Snippets won't retain styles

    kdws
      Hi,
      I'm using RH 7 and trying to create a snippet both from scratch and by right-clicking a topic and using "Add to Snippet Library".

      In both cases, the style sheet that I'm using for the project is not being applied to the snippet. When I try using the topic to create my snippet, I get the msg. "The style sheet <my custom style sheet.css> is outside of the current project and will not be shown in the Project Manager."

      Originally, I thought that this might be due to some broken links because I accidently moved the folder containing my project to a different location (then moved it back). So, I started a new project and imported everything from my original project into the new one. But even with the new project I have the same problem.

      Any ideas?
        • 1. Re: Snippets won't retain styles
          Peter Grainge Adobe Community Professional (Moderator)
          Welcome to the forum.

          Snippets do not link to a stylesheet. The idea is that they take on the stylesheet of whatever topic they appear in.

          If you always want them to appear with a particular style regardless of what topic they are in, for example if you are creating a warning and always want it have a red background, you need to apply inline styles. Embedded stylesheets don't work either. Inline styling only.

          • 2. Re: Snippets won't retain styles
            kdws Level 1
            Thanks, yes, I finally figured this out. It would have saved me about 2 hours of time and a lot of fumbling if the online help had just mentioned that you need to save the snippet before you can drag it into your topic and have it 1) appear, and 2) use the style sheet that the topic uses.

            Maybe this is obvious, but it sure wasn't to me! Anyway, thanks for your help. I'm learning a lot from this forum.
            • 3. Re: Snippets won't retain styles
              Pet3689 Level 1
              I understand this discussion so far.

              However, when editing Snippets, it is possible to change the Style of the Snippet text. There are some basic/default/standard styles available. However, since the Snippets are not associated with any (custom) style sheet, non-basic/default/standard styles are not available.

              For example, my Snippets have a "Header 1", "Normal", "Header 2", "Normal" style, etc. for headings versus normal text. However, I have special formatting too, which I cannot apply in the Snippet (but which does appear in the topic that uses the Snippet).

              Is there some way to apply the topic's Styles to the Snippet?
              • 4. Re: Snippets won't retain styles
                Pet3689 Level 1
                Found the solution to my problem: While Snippets only allow for standard styles by default, it is possible to simply enter a new style name in the style box. Since the Snippet does not recognize this style, it will show up with the "Normal" formatting. However, if this Snippet is placed in a topic that does recognize this style, then the formatting appears properly.

                For example, I use a style called "Title-2" which is similar to "Heading 2". In my Snippet, I enter "Title-2" as the style for my title heading. This title heading is not formatted properly in my Snippet. However, when I load this Snippet in a topic that does have the style "Title-2" defined, the formatting show up properly.

                Yeah!
                • 5. Re: Snippets won't retain styles
                  Peter Grainge Adobe Community Professional (Moderator)
                  Nice idea!

                  Do you have to generate a printed output as well? If you do, check what happens there before you go too far. I have an uncomfortable feeling you would get one format throughout. Haven't tested.

                  • 6. Re: Snippets won't retain styles
                    Pet3689 Level 1
                    Ai. Good idea. Will do.
                    • 7. Re: Snippets won't retain styles
                      Peter Grainge Adobe Community Professional (Moderator)
                      Let us know the result please.