Title: Template Dictionary
Author: radovank
Published: <strong>Ògún  15, 2017</strong>
Last modified: Bélú 16, 2020

---

Ṣàwárí àwọn plugin

Plugin yìí **kò tíì ṣe àyẹ̀wò pẹ̀lú àwọn ìtújáde mẹ́ta pàtàkì tó kẹ́yìn ti WordPress**.
Ó lè jẹ́ pé a kò tọ́jú tàbí ṣe àtìlẹ́yìn fún un mọ́, ó sì lè ní àwọn ọ̀ràn ìbámu
nígbà tí a bá lò ó pẹ̀lú àwọn ẹ̀yà WordPress tuntun.

![](https://s.w.org/plugins/geopattern-icon/template-dictionary.svg)

# Template Dictionary

 Láti ọwọ́ [radovank](https://profiles.wordpress.org/radovank/)

[Ṣe ìgbàsílẹ̀](https://downloads.wordpress.org/plugin/template-dictionary.1.6.1.zip)

 * [Àwọn àlàyé](https://yor.wordpress.org/plugins/template-dictionary/#description)
 * [Àwọn àgbéyẹ̀wò](https://yor.wordpress.org/plugins/template-dictionary/#reviews)
 * [Ìdàgbàsókè](https://yor.wordpress.org/plugins/template-dictionary/#developers)

 [Ìrànlọ́wọ́](https://wordpress.org/support/plugin/template-dictionary/)

## Àpèjúwe

Template Dictionary is a plugin which can be used to create template variables editable
by admins.

The plugin is multilingual ready. It includes Polylang integration, another multilingual
plugin can be integrated with filters.

#### Admin pages

There are few admin pages for managing the plugin.

 * **Template Dictionary** – view, edit and delete the template variables values
 * **Settings list** – view, edit and delete template variables settings
 * **Add setting** – add new or edit template variables setting
 * **Edit values** – edit a value, this page is accessable from the page **Template
   Dictionary**
 * **Export/Import** – export settings and values to xml or import it from xml

#### Usage in template

You can use a value in template by calling function `get` of Template Dictionary
object, which can be accessed by function `TmplDict()`.

For example, if you set a setting with code _the\_code_, you can use itÌtumọ̀ Yorùbá:’
s value by:

    ```
    TmplDict()->get( 'the_code' );
    ```

This function returns the value. If you need to echo the value, you can use function`
eget`. Both functions have an optional argument `$default`, which is the default
returned/echoed value, if the admin value is empty.

You can also get the value by accessing the code as property:

    ```
    $value = TmplDict()->the_code;
    ```

#### Usage with shortcode

You can also use a shortcode `[tmpl_dict]` with attributes `code`, `default` and`
do_shortcode`. The last attribute says, if the function `do_shortcode` will be called
on the value.

#### Setup template language

Default template language can be set by setting the constant `TMPL_DICT_DEFAULT_LANG`
in wp-config. Default value of this constant consists of two first characters of
the current WP locale. **It is important to set the default language constant properly
if you plan to create your site multilingual in future.**

**If you have a multilingual site**, you need to set current template language with
the filter `template_dictionary_language`. For users of Polylang, it is already 
integrated in this plugin, the current template language is the Polylang current
language slug.

#### Setup available languages

**If you have a multilingual site**, you also need to set available languages with
the filter `template_dictionary_languages`. Again, if Polylang is activated, these
available languages consist of Polylang languages slugs.

If your site is not multilingual, there is only one available language – the default
language.

#### Use JS object

To generate JavaScript dictionary object, you need to define `TMPL_DICT_JS_VAR_NAME`
constant. Add to `wp_config.php`:

    ```
    define( 'TMPL_DICT_JS_VAR_NAME', 'dict' );
    ```

Then you can use it in JS:

    ```
    $('#some-element').text( dict.the_code );
    ```

## Àwọn àwòrán ìbòjú

[⌊Setting up a variable⌉⌊Setting up a variable⌉[

Setting up a variable

[⌊Filling out values⌉⌊Filling out values⌉[

Filling out values

[⌊Values list⌉⌊Values list⌉[

Values list

[⌊Various field types⌉⌊Various field types⌉[

Various field types

[⌊Export/Import page⌉⌊Export/Import page⌉[

Export/Import page

[⌊Using values in template⌉⌊Using values in template⌉[

Using values in template

## Àwọn àgbéyẹ̀wò

Kò sí àwọn àgbéyẹ̀wò fún plugin yìí.

## Àwọn Olùkópa & Olùgbéejáde

“Template Dictionary” jẹ́ ètò ìṣàmúlò orísun ṣíṣí sílẹ̀. Àwọn ènìyàn wọ̀nyí ti ṣe
ìkópa sí plugin yìí.

Àwọn Olùkópa

 *   [ radovank ](https://profiles.wordpress.org/radovank/)

[Túmọ̀ “Template Dictionary” sí èdè rẹ.](https://translate.wordpress.org/projects/wp-plugins/template-dictionary)

### Ṣe o nífẹ̀ẹ́ sí ìdàgbàsókè?

[Ṣàwárí koodu](https://plugins.trac.wordpress.org/browser/template-dictionary/),
ṣàyẹ̀wò [ibi ìpamọ́ SVN](https://plugins.svn.wordpress.org/template-dictionary/),
tàbí ṣe àgbékalẹ̀ sí [àkọsílẹ̀ ìdàgbàsókè](https://plugins.trac.wordpress.org/log/template-dictionary/)
nípasẹ̀ [RSS](https://plugins.trac.wordpress.org/log/template-dictionary/?limit=100&mode=stop_on_copy&format=rss).

## Àkọsílẹ̀ àwọn àyípadà

#### 1.6.1

 * Fix: When exporting both settings and values, export empty settings too.
 * Fix: Correct number of placeholders for wpdb::prepare.

#### 1.6

 * Added method to get whole dictionary array.
 * Added JS dictionary object.

#### 1.5

 * Added term field type.
 * Add admin info notice if `TMPL_DICT_DEFAULT_LANG` constant is not set.

#### 1.4

 * Fix: Page for editing settings was not showing.
 * Show admin submenu opened on Edit Values page.

#### 1.3

 * Fix: screen option per_page on settings list
 * Enabled caching of values
 * Set user locale as language in admin if it is in available languages list.
 * Refactored admin pages

#### 1.02

 * Added post-multiple field type.
 * Added method __get for accessing dictionary values as properties.

#### 1.01

 * Fix: notice after deleting setting
 * Do not show empty field options in settings list.

## Àkójọpọ̀ Meta

 *  Ẹ̀yà **1.6.1**
 *  Ìgbàgbọ́hùn tó kẹ́yìn **ọdún 6 sẹ́yìn**
 *  Àwọn ìgbéwọlẹ̀ tó ṣiṣẹ́ **10+**
 *  Ẹ̀yà WordPress ** 4.5 tàbí ju bẹ́ẹ̀ lọ **
 *  Dánwò dé **5.5.23**
 *  Èdè
 * [English (US)](https://wordpress.org/plugins/template-dictionary/)
 * Àwọn àmì
 * [dictionary](https://yor.wordpress.org/plugins/tags/dictionary/)[options](https://yor.wordpress.org/plugins/tags/options/)
   [settings](https://yor.wordpress.org/plugins/tags/settings/)[template](https://yor.wordpress.org/plugins/tags/template/)
   [variables](https://yor.wordpress.org/plugins/tags/variables/)
 *  [Ìwòye Tó Péye](https://yor.wordpress.org/plugins/template-dictionary/advanced/)

## Àwọn ìbò

Kò sí ìwádìí tí a tíì fi ránṣẹ́.

[Your review](https://wordpress.org/support/plugin/template-dictionary/reviews/#new-post)

[Wo gbogbo àwọn àgbéyẹ̀wò](https://wordpress.org/support/plugin/template-dictionary/reviews/)

## Àwọn Olùkópa

 *   [ radovank ](https://profiles.wordpress.org/radovank/)

## Ìrànlọ́wọ́

Nǹkan wà tí o fẹ́ sọ? Ṣé o nílò ìrànlọ́wọ́?

 [Wo àpéjọ ìrànlọ́wọ́](https://wordpress.org/support/plugin/template-dictionary/)