Theme development Get Contact Detail


#1

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


#2

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: https://github.com/pkp/ojs/blob/ojs-stable-3_1_1/pages/index/IndexHandler.inc.php#L47-L71

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).


#3

Thanks you for your hint :hugs: