<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Longhouses &#187; JSON</title>
	<atom:link href="http://www.longhouses.nl/tag/json/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.longhouses.nl</link>
	<description>creëert business</description>
	<lastBuildDate>Mon, 10 Feb 2014 12:13:27 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.2.38</generator>
	<item>
		<title>Option files</title>
		<link>http://www.longhouses.nl/option-files/</link>
		<comments>http://www.longhouses.nl/option-files/#comments</comments>
		<pubDate>Sat, 14 Jul 2012 09:17:02 +0000</pubDate>
		<dc:creator><![CDATA[webmaster]]></dc:creator>
				<category><![CDATA[Theme back-end]]></category>
		<category><![CDATA[back-end]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Option files]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://www.longhouses.nl/?p=427</guid>
		<description><![CDATA[Modification of administration panel content  in GavernWP is very easy &#8211; it is based on JSON files which include a list of options. Thanks to it, creating new options available in an administration panel is very easy. Options files are in gavern/options catalog in a folder connected with a currently used language. In the catalog, [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Modification of administration panel content  in GavernWP is very easy &#8211; it is based on JSON files which include a list of options. Thanks to it, creating new options available in an administration panel is very easy.</p>
<p>Options files are in gavern/options catalog in a folder connected with a currently used language. In the catalog, you will find two main files groups:</p>
<ul>
<li><strong>tabs.json</strong> file &#8211; it includes a list of sections visible on the right side of an administration panel: <a href="http://www.longhouses.nl/wp-content/uploads/2012/07/MeetGavernWP-‹-Meet-Gavern-WP-—-WordPress-1.jpg"><img class="aligncenter size-full wp-image-654" title="Sidebar" src="http://www.longhouses.nl/wp-content/uploads/2012/07/MeetGavernWP-‹-Meet-Gavern-WP-—-WordPress-1.jpg" alt="" width="231" height="485" /></a> each section is described with a table in the form <pre class="gk-code" data-style="style1"><code>["Basic", "options.basic", "enabled"]</code></pre> the first element of a table is a section name displayed in a panel, the second element is a file name without &#8220;<strong>.json</strong>&#8221; extension which stores a list of options available in a section given and the third value refers to whether a section given is visible in a panel. In this case, there will be a <strong>Basic</strong> tab displayed in a panel based on content of <strong>options.basic.json</strong> file.</li>
<li><strong>options.*.json </strong>files &#8211; they include a list of options available in a section given &#8211; their names are strictly connected with the content of <strong>tabs.json</strong> file.</li>
</ul>
<p>Each options.*.json file includes three main fields in an object stored:</p>
<ul>
<li><strong>groupname</strong> &#8211; it is a section title</li>
<li><strong>groupdesc</strong> &#8211; it specifies a section description displayed directly under a  section title</li>
<li><strong>fields</strong> &#8211; it includes a table of objects of fields displayed under the title and a section description</li>
</ul>
<p>Each field defined by an object including the following fields:</p>
<ul>
<li><strong>name</strong> &#8211; it specifies an option name which will be connected with a particular field. There is a prefix added automatically to an option name which is a theme name (it is stored in a global variable &#8211; <strong>$tpl-&gt;name</strong>).</li>
<li><strong>type</strong>&#8211; it specifies a field type. Standard fields are:
<ul>
<li><strong>TextBlock</strong> &#8211; a field including a description text &#8211; it is not used for storing any option value</li>
<li><strong>Text</strong> &#8211; the easiest text field allowing to insert short text values</li>
<li><strong>Textarea</strong> &#8211; a text field used for inserting a greater number of text values</li>
<li><strong>Select</strong> &#8211; a select field</li>
<li><strong>Switcher</strong> &#8211; a checkbox restricted to two options: &#8220;Enabled&#8221; and &#8220;Disabled&#8221;</li>
<li><strong>Media</strong> &#8211; a field allowing to choose images</li>
<li><strong>WidthHeight</strong> &#8211; a field allowing to specify two values defining width and height (mostly used with a Media field)</li>
</ul>
</li>
</ul>
<p>These fields are defined in a <strong>gavern/form_elements/standard.php</strong> file and their code was derived from a <strong>GKFormInput</strong> field. It is worth remembering that files connected with options are parsed by a <strong>gavern/form.parser.php</strong> file. Additionally, you may create your own fields types in a <strong>gavern/form_elements</strong> catalog. In GavernWP, we have included the following fields types:<br />
<strong></strong></p>
<ul>
<li><strong>Menu</strong> &#8211; a field allowing to generate options connected with page&#8217;s menu &#8211; used in a Navigation section</li>
<li><strong>ThemeStyle</strong> &#8211; a field allowing to choose page&#8217;s style &#8211; used at the beginning of a <strong>Basic</strong> section.</li>
</ul>
<p>The description of creating your own fields types we will describe in the further part of this article.</p>
<ul>
<li><strong>label</strong> &#8211; it specifies a label text visible next to a field</li>
<li><strong>tooltip</strong> &#8211; (optional) it allows to specify tooltip content which will appear after mousing over a label of a field given</li>
<li><strong>default</strong> &#8211; default value of a field given</li>
<li><strong>class</strong> &#8211; (optional) this field allows to specify CSS classes added to an element while generating it (if a field code supported such a functionality)</li>
<li><strong>format</strong> &#8211; (optional) a field specifying a desired field content in the form of a regular expression. e.g. value: <pre class="gk-code" data-style="style1"><code>[a-zA-Z]{2,5}</code></pre> specifies that a field given will be filled in correctly only when a user set as its value a sequence of capital or small letters from 2 to 5 symbols.</li>
<li><strong>required</strong> &#8211; (optional) allows to specify whether filling in a particular field was required</li>
<li><strong>visibility</strong> &#8211; (optional) specifies when a particular field is visible. Visibility rules are separated with commas and are created in <strong>FIELD_NAME=VALUE</strong> format &#8211; in the case of a few visibility rules, they are linked with <strong>AND</strong> operator. The value of  <strong>FIELD_NAME</strong> is a name without a prefix with a theme name. e.g. <pre class="gk-code" data-style="style1"><code>option1=10,option2=20</code></pre> will cause that a field given will be visible when an option with <strong>option1</strong> name will be set to <strong>10</strong> and, at the same time, an <strong>option2</strong> option will have have value equals <strong>20</strong>.</li>
<li><strong>other</strong> &#8211; (optional) this field is used for storing additional values, e.g. in the case of a <strong>Select</strong> field, it is used for storing names and options values. This field is very useful when creating more advanced fields which may require additional configuration options.</li>
</ul>
<p>After adding a new option, you have to remember about its support in the theme. Option value is loaded by using a get_option function of a schemata given:</p>
<pre class="gk-code" data-style="style1"><code>get_option($tpl-&gt;name . '_OPTION_NAME', 'DEFAULT_VALUE');</code></pre>
<p>when <strong>OPTION_NAME</strong> is an option name from a JSON file and <strong>DEFAULT_VALUE</strong> is default value of an option which will be used when a user does not specify a value of an option given. What is important, there is a &#8220;<strong>_</strong>&#8221; symbol which you cannot omit. A prefix with a theme name is added in order differentiate values of options of different themes.</p>
<h3>Creating your own field types options</h3>
<p>While creating a new field type, you have to start from creating a catalog compliant with a field name, e.g. <strong>CustomField</strong> in a <strong>gavern/form_elements</strong> catalog. Then, you have to create a config.json file in this catalog and fill it in according to the schemata below:</p>
<pre class="gk-code" data-style="style1"><code>{
"name": "CustomField",
"description": "Example Custom Field",
"js": false,
"css": false,
"php": "customfield.php",
"class": "GKFormInputCustomField"
}</code></pre>
<p><strong>name</strong>, <strong>description</strong>, <strong>php</strong> i <strong>class</strong> fields have to include particular values; js and css fields are optional &#8211; they allow to specify whether a field given has to use additional CSS and JavaScript code (then, a name of files from a field catalog has to be set as a value). Also, you have to create a <strong>customfield.php</strong> file including a <strong>GKFormInputCustomField</strong> class derived after a <strong>GKFormInput</strong> class.</p>
<p>Also, a <strong>customfield.css</strong> file must include a safety code at the beginning:</p>
<pre class="gk-code" data-style="style1"><code>// disable direct access to the file
defined('GAVERN_WP') or die('Access denied');</code></pre>
<p>Each field class has to include at least one public method &#8211; <strong>output</strong> not loading any additional arguments. This method must return HTML code of a field given. Field properties froma JSON file are available as class fields, e.g. <strong>required</strong> is available as:</p>
<pre class="gk-code" data-style="style1"><code>$this-&gt;required</code></pre>
<p>The second important public methid of each class of a form field is a <strong>getValue</strong> method which loads one argument &#8211; <strong>$default</strong>. Its use is optional and useful only when a value of a field given uses more than one field in the data base. Then, it is useful to overwrite this method &#8211; as an example we recommend a standard code of a <strong>WidthHeight</strong> field where overwritting a getValue method was used for storing values of two form fields in one main field created by a <strong>GKInputFormWidthHeight</strong> class.</p>
<p>The remaining class methods have to be created according to the needs of the author of a form  field given.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.longhouses.nl/option-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Color Styles</title>
		<link>http://www.longhouses.nl/color-styles/</link>
		<comments>http://www.longhouses.nl/color-styles/#comments</comments>
		<pubDate>Mon, 09 Jul 2012 09:56:08 +0000</pubDate>
		<dc:creator><![CDATA[webmaster]]></dc:creator>
				<category><![CDATA[Theme Features]]></category>
		<category><![CDATA[colors]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JSON]]></category>

		<guid isPermaLink="false">http://www.longhouses.nl/?p=349</guid>
		<description><![CDATA[GavernWP has an extensive mechanism allowing to create additional theme styles. We may distinguish two main groups of styles in this mechanism: style family styles included in style family given The whole configuration is included in styles.json file: As you can see, it includes color style family which has two styles, namely: Color I and [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>GavernWP has an extensive mechanism allowing to create additional theme styles. We may distinguish two main groups of styles in this mechanism:</p>
<ul>
<li>style family</li>
<li>styles included in style family given</li>
</ul>
<p>The whole configuration is included in <strong>styles.json</strong> file:</p>
<pre class="gk-code" data-style="style1"><code>[{
"family": "color",<br />
"family_desc": "Theme color",<br />
"family_tooltip": "You can select one of the theme colors",<br />
"styles": [<br />
{<br />
"name": "Color I",<br />
"value": "color1",<br />
"file": "style1.css"<br />
},<br />
{<br />
"name": "Color II",<br />
"value": "color2",<br />
"file": "style2.css"<br />
}<br />
]<br />
}]</code></pre>
<p>As you can see, it includes <strong>color</strong> style family which has two styles, namely: <strong>Color I</strong> and <strong>Color II</strong>.</p>
<p>In order to create new style family or a style for style family given, it is enough to create a next object in <strong>styles.json</strong> file and then create CSS files connected with a family given &#8211; in the case of <strong>color</strong> family, these are <strong>style1.css</strong> and <strong>style2.css</strong> files.</p>
<p>GavernWP will load CSS files of a style given in a <strong>head</strong> section &#8211; chosen in an administration panel or, if there is a tool for choosing user&#8217;s styles switched on, they will be loaded based on a Cookie file storing data about a style used by a user.</p>
<p>You have to remember that for each style family there is at least one CSS file loaded. Therefore, creating coexisting style families like:</p>
<ul>
<li><strong>dark styles</strong> and <strong>light styles</strong></li>
<li><strong>blue styles</strong> and <strong>green styles</strong></li>
</ul>
<p>is incorrect because at least one CSS style from each family will be loaded immediately. So the correct one is creating style families responsible for some elements of website styling, e.g. a separate family responsible for website coloring (<strong>colors</strong>) and a separate one for website background (<strong>patterns</strong>).</p>
<p>Generally, you have to care about particular style families in order not to overwrite one another.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.longhouses.nl/color-styles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSON Configuration</title>
		<link>http://www.longhouses.nl/json-configuration/</link>
		<comments>http://www.longhouses.nl/json-configuration/#comments</comments>
		<pubDate>Sun, 08 Jul 2012 10:07:26 +0000</pubDate>
		<dc:creator><![CDATA[webmaster]]></dc:creator>
				<category><![CDATA[Theme Features]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[menus]]></category>
		<category><![CDATA[Open Graph]]></category>
		<category><![CDATA[widgets]]></category>

		<guid isPermaLink="false">http://www.longhouses.nl/?p=338</guid>
		<description><![CDATA[In order to make GavernWP framework more flexible, we decided to use files in JSON format for storing thme&#8217;s configuration and options layout in an administration panel. You may find files responsible for theme&#8217;s configuration in gavern/options/ catalog: fonts.json &#8211; a file which stores theme&#8217;s groups of fonts. By default, there are three main gropus [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>In order to make GavernWP framework more flexible, we decided to use files in JSON format for storing thme&#8217;s configuration and options layout in an administration panel.</p>
<p>You may find files responsible for theme&#8217;s configuration in <strong>gavern/options/</strong> catalog:<strong></strong></p>
<ul>
<li><strong>fonts.json</strong> &#8211; a file which stores theme&#8217;s groups of fonts. By default, there are three main gropus created. In order to create a new group, it is enough to add a next object to the object table existing in this file.plik przechowujący grupy czcionek szablonu.</li>
<li><strong>menus.json</strong> &#8211; you will find space for menu used in a theme in this file. You have to remember that except adding a new object, you have to add PHP code generating menu data in theme&#8217;s code. It is also worth remembering that there could be one main menu (<strong>main</strong> field in menu object).<strong></strong></li>
<li><strong>opengraph.json</strong> &#8211; this file includes configuration of fields used in a block connected with metabox which is used for generating Open Graph data. We do not recommend to make any changes in it before you get acquainted with Open Graph tags implementation in GavernWP framework.</li>
<li><strong>styles.json</strong> &#8211; this file is used for generating additional theme&#8217;s styles. Except adding a new style, you have to remember about creating an additional CSS file which will be loaded while changing theme&#8217;s style.</li>
<li><strong>template.json</strong> &#8211; it is the most important configuration file. It includes information about a theme and it allows to switch off chosen elements of theme administration panel. It is NOT recommended to add new fields to this files because they will not be used without additional PHP code.</li>
<li><strong>widgets.json</strong> &#8211; a file including a list of all positions of widgets. Similarly to <strong>menus.json</strong> file, you have to remember that except adding a new widget position, you have to also add PHP code which generates it in a theme.</li>
<li><strong>widgets.styles.json</strong> &#8211; a file used for creating new widget styles. Thanks to its implementation, it allows to assign a style given to one widget type only or exclude some widget types from a style given.</li>
</ul>
<p>In order to understand better JSON files format, we recommend to visit the official website of  <a href="http://www.json.org/">this format</a>.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.longhouses.nl/json-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Translations</title>
		<link>http://www.longhouses.nl/translations/</link>
		<comments>http://www.longhouses.nl/translations/#comments</comments>
		<pubDate>Sun, 08 Jul 2012 09:53:55 +0000</pubDate>
		<dc:creator><![CDATA[webmaster]]></dc:creator>
				<category><![CDATA[Theme Features]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[translations]]></category>

		<guid isPermaLink="false">http://www.longhouses.nl/?p=335</guid>
		<description><![CDATA[GavernWP has full support for making translations. Because of differences being a result of using JSON files for generating theme&#8217;s options, a theme&#8217;s translation should be done in three places: with files use from a languages catalog by creating a catalog of a language given in a config catalog by creating a catalog of a [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>GavernWP has full support for making translations. Because of differences being a result of using JSON files for generating theme&#8217;s options, a theme&#8217;s translation should be done in three places:</p>
<ol>
<li>with files use from a languages catalog</li>
<li>by creating a catalog of a language given in a config catalog</li>
<li>by creating a catalog of a language given in an options catalog</li>
</ol>
<p>The first stage is a standard operation described in details in WordPress documentation. Let&#8217;s focus on the two remaining stages then:</p>
<p>Generally, there is <strong>en_US</strong> catalog created in <strong>config</strong> and <strong>options</strong> catalogs which includes JSON configuration files in an English language. So, in order to translate a theme to a different language , you have to copy this catalog and change its name to a respective language used in your installation, e.g. <strong>pl_PL</strong>. Then, you have to change all phrases from the English language to your language.</p>
<p>NOTE! You must not change the names of keys in JSON files, the same as, proper names because they are used for proper work and reading values.</p>
<p>e.g. in a widgets.json file for a fragment:</p>
<pre class="gk-code" data-style="style1"><code>{<br />
"name": "Top widgets",<br />
"id": "top",<br />
"description": "Widgets area on under the header of website",<br />
"before_widget": "&lt;div id=\"%1$s\" class=\"box%2$s\"&gt;",<br />
"after_widget": "&lt;/div&gt;",<br />
"before_title": "&lt;h3 class=\"box-title\"&gt;",<br />
"after_title": "&lt;/h3&gt;"<br />
},</code></pre>
<p>change the following phrases only:</p>
<ul>
<li>&#8220;Top widgets&#8221;</li>
<li>&#8220;Widgets area on under the header of website&#8221;</li>
</ul>
<p>After this operation, you will see sentences in your mother tongue in an administration panel.</p>
<p>It&#8217;s worth remembering that in the case when GavernWP will not find a catalog corresponding to the language set in configuration, there will be files used from <strong>en_US</strong> catalogs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.longhouses.nl/translations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Framework structure</title>
		<link>http://www.longhouses.nl/framework-structure-2/</link>
		<comments>http://www.longhouses.nl/framework-structure-2/#comments</comments>
		<pubDate>Sun, 08 Jul 2012 09:30:56 +0000</pubDate>
		<dc:creator><![CDATA[webmaster]]></dc:creator>
				<category><![CDATA[Theme essentials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Custom Pages]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[translations]]></category>

		<guid isPermaLink="false">http://www.longhouses.nl/?p=330</guid>
		<description><![CDATA[Gavern Framework has a quite extensive files structure. It is similar to a standard structure of majority of the themes, however, because of many functionalities, there are some new elements. The overall outline of files structure is presented below: theme&#8217;s catalog It includes all basic files and catalogs for a theme. It is worth seeing [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Gavern Framework has a quite extensive files structure. It is similar to a standard structure of majority of the themes, however, because of many functionalities, there are some new elements.</p>
<p><span id="more-330"></span></p>
<p>The overall outline of files structure is presented below:</p>
<ol>
<li><strong>theme&#8217;s catalog</strong><br />
<small>It includes all basic files and catalogs for a theme. It is worth seeing that Custom Pages templats have a <strong>theme.</strong> prefix at the beginning of their names which helps to find them in files structure.</small></p>
<ol>
<li><strong>css</strong><br />
<small>There are all CSS theme&#8217;s files in it. They are described in details in an entry about framework&#8217;s CSS code.<br />
</small></p>
<ol>
<li><strong>back-end</strong><br />
<small>To have everything ordered, CSS files connected with an administration panel were placed in this catalog.<br />
</small></li>
</ol>
</li>
<li><strong>fonts</strong><br />
<small>This catalog is used for storing files with additional fonts. You have to remember that each font must have its own catalog including a stylesheet.css file. More information about fonts service can be found in an entry about <strong>Fonts</strong> in an administration panel.<strong></strong><br />
</small></li>
<li><strong>gavern</strong><br />
<small>A catalog including the base of whole GavernWP framework work.<br />
</small></p>
<ol>
<li><strong>classes</strong><br />
<small>Files with supporting classes used in framework&#8217;s code.<br />
</small></li>
<li><strong>config</strong><br />
<small>Files including framework&#8217;s configuration. It has to be remembered that there are additional catalogs used for making transalations.<br />
</small></li>
<li><strong>form_elements</strong><br />
<small>It includes a main file with a code which generates basic form elements in an administration panel, as well as, catalogs with elements created by a user.<br />
</small></li>
<li><strong>helpers</strong><br />
<small>A collection of classes connected with specific framework&#8217;s tasks, e.g. with generating layout fragments.<br />
</small></li>
<li><strong>layouts</strong><br />
<small>Files used for generating HTML code of an administration panel.<br />
</small></li>
<li><strong>options</strong><br />
<small>Files which store options of particular sections of theme&#8217;s administration panel. Similarly to <strong>config</strong> catalog; there are also additional catalogs used for making translations.<strong></strong><br />
</small></li>
</ol>
</li>
<li><strong>images</strong><br />
<small>Graphic files used with a theme<br />
</small></p>
<ol>
<li><strong>back-end</strong><br />
<small>Files connected with an administration panel.<br />
</small></li>
<li><strong>headers</strong><br />
<small>Default header&#8217;s images.<br />
</small></li>
<li><strong>post_formats</strong><br />
<small>Images connected with entries formats.<br />
</small></li>
</ol>
</li>
<li><strong>js</strong><br />
<small>JavaScript scripts files used in a thme<br />
</small></p>
<ol>
<li><strong>back-end</strong><br />
<small>Likewise in <strong>css</strong> and <strong>images</strong> catalogs there are files included used in an administration panel.<strong></strong><strong></strong><br />
</small></li>
<li><strong>templates</strong><br />
<small>Additional JavaScript files used by some Custom Pages.<br />
</small></li>
</ol>
</li>
<li><strong>languages</strong><br />
<small>Main files used for creating translations.<br />
</small></li>
<li><strong>layouts</strong><br />
<small>Files used for generating subpages; they include elements which are used very often; e.g. a head section.<br />
</small></li>
</ol>
</li>
</ol>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.longhouses.nl/framework-structure-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
