<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://prsdigital.com.au/wiki/index.php?action=history&amp;feed=atom&amp;title=Web_Style</id>
	<title>Web Style - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://prsdigital.com.au/wiki/index.php?action=history&amp;feed=atom&amp;title=Web_Style"/>
	<link rel="alternate" type="text/html" href="https://prsdigital.com.au/wiki/index.php?title=Web_Style&amp;action=history"/>
	<updated>2026-06-16T10:30:07Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://prsdigital.com.au/wiki/index.php?title=Web_Style&amp;diff=114&amp;oldid=prev</id>
		<title>Prs: Created page with &quot;  WebStyles are closely associated with WebTemplates, providing a means by which one can apply stylesheets to their pages. Using this system allows for a consistent styling across pages (or a subset of pages), since they would all speak to a certain WebStyle. Note also that despite being intended for CSS styling, they can contain any data, meaning the system could be used for other types of documents.  ==Fields== ===Code=== The Code field is the unique identifier by whic...&quot;</title>
		<link rel="alternate" type="text/html" href="https://prsdigital.com.au/wiki/index.php?title=Web_Style&amp;diff=114&amp;oldid=prev"/>
		<updated>2022-10-18T23:15:57Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;  WebStyles are closely associated with WebTemplates, providing a means by which one can apply stylesheets to their pages. Using this system allows for a consistent styling across pages (or a subset of pages), since they would all speak to a certain WebStyle. Note also that despite being intended for CSS styling, they can contain any data, meaning the system could be used for other types of documents.  ==Fields== ===Code=== The Code field is the unique identifier by whic...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
WebStyles are closely associated with WebTemplates, providing a means by which one can apply stylesheets to their pages. Using this system allows for a consistent styling across pages (or a subset of pages), since they would all speak to a certain WebStyle. Note also that despite being intended for CSS styling, they can contain any data, meaning the system could be used for other types of documents.&lt;br /&gt;
&lt;br /&gt;
==Fields==&lt;br /&gt;
===Code===&lt;br /&gt;
The Code field is the unique identifier by which a given WebStyle is accessed. This should be somewhat descriptive, since it must be referenced via other pages, but it is recommended to keep it short and sweet.&lt;br /&gt;
===Description===&lt;br /&gt;
An arbitrary field by which one can give a description for the WebStyle. It is non-functional, but provides a reference on top of the code for humans to identify the purpose or contents of the WebStyle.&lt;br /&gt;
==How To Use==&lt;br /&gt;
Once you have created a [[PRS/WebTemplate|WebTemplate]], you can pull in stylesheets through the WebDatabaseInterface class. Simply call &amp;lt;code&amp;gt;WebDatabaseInterface.GetStylesheet(code)&amp;lt;/code&amp;gt;, which returns an object of type &amp;lt;code&amp;gt;WebStyle&amp;lt;/code&amp;gt;. This class has an attribute named &amp;lt;code&amp;gt;Style&amp;lt;/code&amp;gt;, which contains the raw text from the WebStyle. Thus, to load and apply a style, put this markup in the &amp;lt;code&amp;gt;&amp;lt;head&amp;gt;&amp;lt;/code&amp;gt; tag of your template:&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;style&amp;gt; @(WebDatabaseInterface.GetStylesheet(&amp;quot;EXAMPLE&amp;quot;).Style) &amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Loading Multiple Stylesheets===&lt;br /&gt;
Since each call to &amp;lt;code&amp;gt;GetStylesheet&amp;lt;/code&amp;gt; results in a request to the database, it can be beneficial to load multiple stylesheets at once. This is made possible with the &amp;lt;code&amp;gt;GetStylesheets&amp;lt;/code&amp;gt; function, as demonstrated:&amp;lt;pre&amp;gt;&lt;br /&gt;
Dictionary&amp;lt;string, WebStyle&amp;gt; styles = WebDatabaseInterface.GetStylesheets(&amp;quot;FIRST&amp;quot;, &amp;quot;SECOND&amp;quot;);&lt;br /&gt;
&amp;lt;style&amp;gt;&lt;br /&gt;
@(styles[&amp;quot;FIRST&amp;quot;].Style)&lt;br /&gt;
@(styles[&amp;quot;SECOND&amp;quot;].Style)&lt;br /&gt;
&amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Prs</name></author>
	</entry>
</feed>