How do I setup custom styles in a wiki template? - FogBugz Knowledge Exchange most recent 30 from http://fogbugz.stackexchange.com2013-05-26T04:56:37Zhttp://fogbugz.stackexchange.com/feeds/question/2798http://www.creativecommons.org/licenses/by-nc/2.5/rdfhttp://fogbugz.stackexchange.com/questions/2798/how-do-i-setup-custom-styles-in-a-wiki-templateHow do I setup custom styles in a wiki template?FogBugz FAQ2010-04-20T18:30:39Z2012-06-13T19:24:27Z
<p>How do I add options to the wiki editor for fonts, sizes and styles via a template?</p>
http://fogbugz.stackexchange.com/questions/2798/how-do-i-setup-custom-styles-in-a-wiki-template/2799#2799Answer by adambox for How do I setup custom styles in a wiki template?adambox2010-04-20T18:30:59Z2012-06-13T19:24:27Z<h1>FogBugz 8</h1>
<p>The guide below is for version 7 only. FogBugz 8 introduced a new editor, CKEditor, which unfortunately removed this feature. See <a href="http://fogbugz.stackexchange.com/questions/4464/feature-request-restore-ability-to-have-custom-styles-show-in-fogbugz-8-wiki-edi" rel="nofollow">this post</a> for more information.</p>
<h1>FogBugz 7</h1>
<p>Each Wiki in FogBugz has a template assigned to it. In the template, you can customize the HTML and CSS of pages. You can change existing options by changing these classes in the template CSS, and add new ones by following the existing examples. Just look for the section headers in the template as shown below:</p>
<h3>Font Families</h3>
<p>Fonts Families must define the <strong>font-family</strong> property. They can include other CSS properties, but it can get confusing. e.g. if you define <strong>font-size</strong>, the style will also appear in the size menu.</p>
<pre><code>/* Font Families */
span.Arial { font-family: Arial, Helvetica, sans-serif }
...
</code></pre>
<h3>Font Sizes</h3>
<p>Sizes must define the <strong>font-size</strong> property. They can include other CSS properties, but it can get confusing. e.g. if you define <strong>font-family</strong>, the style will also appear in the font menu.</p>
<pre><code>/* Font Sizes */
...
span.Big { font-size: 20px }
...
</code></pre>
<h3>Paragraph Styles</h3>
<p>These show up in the menu under the <strong>Body</strong> entry in the style menu.</p>
<pre><code>/* Paragraph Styles */
...
p.ExtraPadding { padding: 25px; }
</code></pre>
<h3>Code Blocks & Quotes</h3>
<p>There is only one <strong>Code</strong> option in the style menu, but you can change its properties by adding something like (make sure the C in Code is capitalized):</p>
<pre><code>p.Code {color: red}
</code></pre>
<p>You can also modify the single <strong>Quote</strong> style in this way. Again, make sure the Q in Quote is capitalized:</p>
<pre><code>p.Quote { font-style:italic }
</code></pre>
<h3>Heading Styles</h3>
<p>Heading styles are listed in the style menu from <strong>Heading 1</strong> to <strong>Heading 6</strong>. You can define custom versions of each which appear below them in the style menu.</p>
<pre><code>/* Heading Styles */
h1.HugeBlue { font-size:100px; color: blue; }
...
</code></pre>
<h3>Image Styles</h3>
<p>Image styles are show as options when you right-click on an image and choose <strong>Image Properties</strong></p>
<pre><code>/* Image Styles */
img.FloatLeft { float: left; }
...
</code></pre>
<h3>Table Styles</h3>
<p>You can create new styles (or modify existing ones) for the various elements of tables (<strong>tr</strong>, <strong>td</strong>, etc). For example:</p>
<pre><code>/* Table Styles */
...
table.Ludicrous { font-size: 100px; BORDER-COLLAPSE: collapse; }
table.Ludicrous TR TD { border:1px solid black; color: white; background-color: black; }
table.Ludicrous TR TH { border:1px solid black; background-color: blue; }
table.Ludicrous TD.LessLudicrous { font-size:20px; background-color: white; color: black;}
</code></pre>
<h3>Other Styles</h3>
<p>You can set the styles for elements of the HTML template, such as <code>#idContainer</code>, and change and add to the list of color choices (in the <code>/* Palette Colors */</code> section).</p>
<p>You can also customize the style of tags when they appear within a type of table cell, paragraph style, etc. For example:</p>
<pre><code>/* a custom paragraph */
p.special { margin-left: 20px; color: #003333; }
/* something different for underlined text in "special" paragraphs only */
.special u { color:red; }
</code></pre>
<p>or change the style of strikethrough, underline, italic and bold universally</p>
<pre><code>u { color:red }
i { someproperty:somevalue }
b { someproperty:somevalue }
strike { someproperty:somevalue }
</code></pre>
<h3>Print Formatting</h3>
<p>Define styles for printing in the section at the bottom:</p>
<pre><code>@media print {
/* Customize the styles of your printed articles by adding styles within this @media block. */
}
</code></pre>
<h3>Tutorial</h3>
<p>One of our developers, <a href="http://fogbugz.stackexchange.com/users/67/ben-kamens" rel="nofollow">Ben</a> posted <a href="http://www.fogcreek.com/FogBugz/blog/post/Customizing-Your-FogBugz-Wiki-and-Editor.aspx" rel="nofollow">this excellent tutorial</a> to show you how these CSS elements work.</p>