# Template code overview

**URL:** <https://forum.pkp.sfu.ca/t/template-code-overview/64577>\
**Category:** Software Support\
**Tags:** theme-development\
**Created:** [December 8, 2020, 9:45am UTC](https://forum.pkp.sfu.ca/t/template-code-overview/64577 "2020-12-08T09:45:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![basD](https://forum.pkp.sfu.ca/letter_avatar/basd/32/5_5575768a8748004e209b776fc1b2916d.png) [@basD](https://forum.pkp.sfu.ca/u/basD)\
**Post date:** [December 8, 2020, 9:45am UTC](https://forum.pkp.sfu.ca/t/template-code-overview/64577/1 "2020-12-08T09:45:03Z")

</div>

Hi all,  
I’m building a OJS theme from scratch. I’m getting a lots of information from the default theme’s but I can’t seem to find a complete overview of the all the template codes? Is there a complete overview of all the template codes?

Thanks in advance!  
Gr Bas

OJS 3.2.1.1

---

<div class="post-metadata">

**Author:** ![Vitaliy](https://forum.pkp.sfu.ca/user_avatar/forum.pkp.sfu.ca/vitaliy/32/3230_2.png) [@Vitaliy](https://forum.pkp.sfu.ca/u/Vitaliy)\
**Post date:** [December 8, 2020, 10:37am UTC](https://forum.pkp.sfu.ca/t/template-code-overview/64577/2 "2020-12-08T10:37:32Z")

</div>

Hi @basD,

There is a theming guide: [PKP Theming Guide](https://docs.pkp.sfu.ca/pkp-theming-guide/en/)  
Plugin guide may also be helpful: [Plugin Guide for OJS and OMP](https://docs.pkp.sfu.ca/dev/plugin-guide/en/)

---

<div class="post-metadata">

**Author:** ![basD](https://forum.pkp.sfu.ca/letter_avatar/basd/32/5_5575768a8748004e209b776fc1b2916d.png) [@basD](https://forum.pkp.sfu.ca/u/basD)\
**Post date:** [December 8, 2020, 11:44am UTC](https://forum.pkp.sfu.ca/t/template-code-overview/64577/3 "2020-12-08T11:44:53Z")

</div>

Thanks for your quick response, @Vitaliy! I know the theming guide, that’s was great starting point for me. But now it doesn’t help ansering questions like how to call a theme option variable on the site indexpage where I list all the journals.  
`$journal->getOption('baseColour') // this doens't work.`

---

<div class="post-metadata">

**Author:** ![Vitaliy](https://forum.pkp.sfu.ca/user_avatar/forum.pkp.sfu.ca/vitaliy/32/3230_2.png) [@Vitaliy](https://forum.pkp.sfu.ca/u/Vitaliy)\
**Post date:** [December 8, 2020, 11:54am UTC](https://forum.pkp.sfu.ca/t/template-code-overview/64577/4 "2020-12-08T11:54:59Z")

</div>

I don’t think `Journal` class has `getOption()` method. `$activeTheme` variable [is assigned to all front-end templates](https://github.com/pkp/pkp-lib/blob/538dc7ad6856f47b860a79b870ddf7db852ecbca/classes/template/PKPTemplateManager.inc.php#L178), I believe you can use it to get the theme options from the site index page.

---

<div class="post-metadata">

**Author:** ![basD](https://forum.pkp.sfu.ca/letter_avatar/basd/32/5_5575768a8748004e209b776fc1b2916d.png) [@basD](https://forum.pkp.sfu.ca/u/basD)\
**Post date:** [December 8, 2020, 12:03pm UTC](https://forum.pkp.sfu.ca/t/template-code-overview/64577/5 "2020-12-08T12:03:22Z")

</div>

Thanks @Vitaliy. Is there a place where I can find that information: what methods has $journal and what methods does $activeTheme have.

---

<div class="post-metadata">

**Author:** ![Vitaliy](https://forum.pkp.sfu.ca/user_avatar/forum.pkp.sfu.ca/vitaliy/32/3230_2.png) [@Vitaliy](https://forum.pkp.sfu.ca/u/Vitaliy)\
**Post date:** [December 8, 2020, 2:34pm UTC](https://forum.pkp.sfu.ca/t/template-code-overview/64577/6 "2020-12-08T14:34:22Z")

</div>

Only in the code. `$journal` variable is an object, instance of the `Journal` class, usually, this info can be found in the template’s docs e.g. [here](https://github.com/pkp/ojs/blob/7192a7c717fd2986ffd44c9aed205183fa71c64a/templates/frontend/pages/indexJournal.tpl#L10), but not in this case. I suggest then search for the [Journal](https://github.com/pkp/ojs/blob/7192a7c717fd2986ffd44c9aed205183fa71c64a/classes/journal/Journal.inc.php) class and parent classes as well ([Context](https://github.com/pkp/pkp-lib/blob/915dfe4419b6476ec8aca55559b4ac02175b261e/classes/context/Context.inc.php))

Also there is `getData()` and `getLocalizedData()` getters, which allow to retrieve properties of an object, i.e., Journal/Context, Submission, Issue, Galley, Publication. You can find properties description in the `schemas` and `lib/pkp/schemas` folder.

As for `$activeTheme`, it’s an instance of the main theme class, which also inherits all method of the `ThemePlugin` class + parent theme methods if it’s a child theme

---

<div class="post-metadata">

**Author:** ![basD](https://forum.pkp.sfu.ca/letter_avatar/basd/32/5_5575768a8748004e209b776fc1b2916d.png) [@basD](https://forum.pkp.sfu.ca/u/basD)\
**Post date:** [December 8, 2020, 3:01pm UTC](https://forum.pkp.sfu.ca/t/template-code-overview/64577/7 "2020-12-08T15:01:01Z")

</div>

Thanks @Vitaliy! I will dive in to that.  
Gr Bas
