Page 1 of 1

snippet content

Posted: Sun Sep 28, 2014 4:24 am
by jbananak
Hi
Can I enter code in a snippet or just content? (for example, I have lots of tables that start "
<table style="margin-left: 1pt;border-collapse: collapse;">
<col style="width: 29pt;" />
<col style="width: 500pt;" />
<tr style="height: 29pt;">
<td class="NoteIconCol">
<p class="WarningIcon">
<img src="../Resources/Images_Breeze/Note Image.tif" style="visibility: visible;mso-wrap-style: square;width: 33px;height: 36px;" />
</p>
</td>
<td class="notecell">
<p class="NoteTitle">NOTE:</p>
Can this be a snippet?

Re: snippet content

Posted: Sun Sep 28, 2014 5:46 am
by RamonS
You want the above show as text? If yes, I see no reason not to put it in a snippet, it should not be rendered but instead displayed as code. You will lose any spacing if you do not insert non-breakable spaces.

Re: snippet content

Posted: Mon Sep 29, 2014 2:52 am
by Msquared
I don't think you can do this at the topic code level, unless someone knows otherwise . . . You can only use snippets for topic text. And even then, you can't put one or more table rows in a snippet, although several of us have asked for that as an enhancement. You can put a whole table in a snippet, and you can put the contents of a cell in a snippet, but that's all at present.

You are obviously looking to standardise and reuse your table content in a consistent and repeatable way, so this is what I'd do. it's not as nice as you would like to be able to do, but it's acceptable and better than nothing.

I'd make a "normal" snippet containing your table, with the defined column widths, and your first row containing your warning note and image. Then I'd place this wherever you want a table that begins like that. Then, I'd convert the snippet to text, which will leave you with a correctly placed table of the correct style, with the content you require. This will allow you to edit the table and add any more rows you may require.

The downside is that if you want to change something about all the existing tables you have placed so far, you won't be able to do it be changing the snippet, since you've only used the snippet as a template for the table, then broken the reference to the snippet when you converted it to text.

There is something else you could consider in your case, and that's making this first bit of your table a separate table (so it can be inside a snippet), and making the rest of your table a separate table that is styled to join up exactly to this table, with no space between them. You appear to be able to do this as you are specifying your column widths, so they will always be the same for both tables. Unfortunately, most of my tables work best when I allow Flare to auto-size them, and in that case you can see the join as the two tables will almost certainly have different column widths.