Theme development Get Contact Detail

I am on progress developing theme, but get some issues. The documentation on theme guides seem very limited.

I want to get ISSN, Contact information on my indexJournal site.
adding some annotation on the header line of my footer.tpl file with this script :

  • @uses $mailingAddress string Mailing address for the journal/press
  • @uses $contactName string Primary contact name
  • @uses $contactTitle string Primary contact title
  • @uses $contactAffiliation string Primary contact affiliation
  • @uses $contactPhone string Primary contact phone number
  • @uses $contactEmail string Primary contact email address
  • @uses $supportName string Support contact name
  • @uses $supportPhone string Support contact phone number
  • @uses $supportEmail string Support contact email address

and use it on my footer.tpl

i try to echo / show the {$supportName} as sample but weirdly it just show blank on indexJournal but on page /about/contact it becomes appear, it happens on any other smarty contact variable too such as {$supportEmail} and so on.

mm… another question is. How i can retrieve ISSN or which variable should i type ?
(i try to find it on templates folder using vs code but nothing it can find :thinking:

thanks

1 Like

Hi @navotera

It’s probably because those variables weren’t assigned to the indexJournal page. If you have doubts that annotation isn’t full in some way, you can take a look at the correspondent controller. All variables that are assigned to that page are here: ojs/IndexHandler.inc.php at ojs-stable-3_1_1 · pkp/ojs · GitHub

There are also some global variables that are assigned to all templates.

If needed variable is absent, it can be added from the Theming API. For example, this method retrieves latest issues by using a hook. This specific hook allows interacting with Smarty templates. Particularly, in this case, retrieving data regarding the template and assigning variables.

So, in response to your question, you need to retrieve needed data from OJS’s backend and assign it to the template(s).

2 Likes

Thanks you for your hint :hugs:

1 Like

Hi, Vitaliy! Could you guide me how can I make the modification in the indexJournal so that the contact / email / phone / match in the footer?
Should I configure in the pages or indexJournal of the plugin?

Hi @monicalp,

I’m not sure thta I’m understanding this right. In the footer there is a special TinyMCE block that contains data entered from an admin dashboard. Do you want to duplicate this block on the index journal page?

1 Like

I’m actually making a theme for magazines where in the footer will automatically appear the postal address, publisher name, phone and email. But I can not do as you explained up there. I would have to do a function that brings this data from the database to be able to display, right? Or could you modify it in indexJornaul.tpl?

For the indexJournal.tpl to retrieve address you can use:

{$currentJournal->getSetting('mailingAddress')}

Where $currentJournal is an instance of Journal class. E.g., take a look at: Common Template Variables
For localized settings the method is getLocalizedSetting(). For using in footer it’s bit more complicated because this variable is not assigned to all pages. You need to call this object and assign to Smarty: Passing Data to Templates

1 Like