[OJS 3.3] Show ISSN and Publisher

Greetings,

I wanted to add the The ISSN and Publisher along with the article description as shown in the image. What file must i change in order to make this change?
I tried to locate the file but no no success, is it possible to know through the developer tools? and If so how.

publisher

Best regards,
José Nobre

Hi @josenobre,

I think this would require modifying the theme for your site - what theme are you using - and what version? Not sure if you have had a look at our theming documentation or not: PKP Theming Guide - that might be a good place to start. My colleague @Vitaliy may also be able to advise.

-Roger
PKP Team

Hi @rcgillis

I’m using Manuscripts latest version for OJS 3.3, version 1.0.3.1.
I’ve already read the Theming guide but i will re-read it in case i missed something

Best regards,
José Nobre

Hi all,

It looks like journal index page, so templates/frontend/pages/indexJournal.tpl. Manuscript theme is a child of a Default theme and inherits this and other templates from the latter. I’d create a child theme of a Manuscript (making it a grandchild of the Default theme) and override the template with custom changes to make them sustainable. As far as I remember, grandchild themes should behave normally.

Hi @Vitaliy

Thank you for your response.
I’m fallowing this guide and would like to ask how i can find the code that identifies the ISSN and publisher?

Best regards,
José Nobre

E.g.:

PKPApplication::get()->getRequest();
$context = $request->getContext();
$printIssn = $context->getData('printIssn');
$onlineIssn = $context->getData('onlineIssn');
$publisherName = $context->getData('publisherInstitution');

Hi @Vitaliy,

Thank you for your response.
I still have some doubts. This is my forked file (i never worked with PHP so there might be some errors), the guide explains how to add and modify CSS, LESS and Javascript but not TPL.
Could you explain me how to do it?

I also wanted to make add target="_blank" to the homepage so that when someone clicks on one of journals it opens on a new tab.
I think i found the correct file, indexSite.tpl, Processing: indexSite.tpl… but noticed no change after editing it.

<div class="journals">
		<h2>
			{translate key="context.contexts"}
		</h2>
		{if $journals->wasEmpty()}
			{translate key="site.noJournals"}
		{else}
			<ul>
				{iterate from=journals item=journal}
					{capture assign="url"}{url journal=$journal->getPath()}{/capture}
					{assign var="thumb" value=$journal->getLocalizedData('journalThumbnail')}
					{assign var="description" value=$journal->getLocalizedDescription()}
					<li{if $thumb} class="has_thumb"{/if}>
						{if $thumb}
							<div class="thumb">
								<a href="{$url|escape}" target="_blank">
									<img src="{$journalFilesPath}{$journal->getId()}/{$thumb.uploadName|escape:"url"}"{if $thumb.altText} alt="{$thumb.altText|escape|default:''}"{/if}>
								</a>
							</div>
						{/if}

						<div class="body">
							<h3>
								<a href="{$url|escape}" rel="bookmark" target="_blank">
									{$journal->getLocalizedName()}
								</a>
							</h3>
							{if $description}
								<div class="description">
									{$description|nl2br}
								</div>
							{/if}
							<ul class="links">
								<li class="view">
									<a href="{$url|escape}" target="_blank">
										{translate key="site.journalView"}
									</a>
								</li>
								<li class="current">
									<a  href="{url|escape journal=$journal->getPath() page="issue" op="current"}" target="_blank">
										{translate key="site.journalCurrent"}
									</a>
								</li>
							</ul>
						</div>
					</li>
				{/iterate}
			</ul>
		{/if}
	</div>

Best regards,
José Nobre

  1. Override template: Child Themes (just copy a template to a correspondent directory of a child theme)
  2. Look at the template docs at the top of the template to see assigned variables: ojs/indexJournal.tpl at main · pkp/ojs · GitHub
  3. If the variable isn’t assigned, you’ll need to do it by yourself, e.g.: oldGregg/OldGreggThemePlugin.inc.php at 6094ee4d39bac1827ecb2fafddbc2c69fa684a5b · Vitaliy-1/oldGregg · GitHub
  4. Use variable to display data, e.g., {$currentJournal->getData('printIssn')}. Smarty documentation for more info about template syntax: Documentation | Smarty (OJS 3.3 Uses Smarty version 3)

According to the linked example the first step is missing. indexSite.tpl should be placed in templates/frontend/pages/

Hi @Vitaliy

Thank you for your response.
I’ve been trying to add the issn but I’ve been receiving this error.

Fatal error: Uncaught Error: Call to a member function getData() on null in /var/www/revistas-prod/ojs/cache/t_compile/b9da708b775ca192cb9735589afa7e98b537357a^26de9c47ced54328a8eb56e39bb4d4079aa049c6_0.app.frontendobjectsissuetoc.t.php:121 Stack trace: #0 /var/www/revistas-prod/ojs/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_611a454ad3d905_60514370(Object(Smarty_Internal_Template)) #1 /var/www/revistas-prod/ojs/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template)) #2 /var/www/revistas-prod/ojs/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template)) #3 /var/www/revistas-prod/ojs/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(385): Smarty_Internal_Template->render() #4 /var/www/revistas-prod/ojs/cache/t_compile/b9da708b775ca192cb9 in /var/www/revistas-prod/ojs/cache/t_compile/b9da708b775ca192cb9735589afa7e98b537357a^26de9c47ced54328a8eb56e39bb4d4079aa049c6_0.app.frontendobjectsissuetoc.t.php on line 121

This is the code i added to the issue_toc.tpl:

		{* ISSN *}
			<div class="published">
				<span class="label">
					{translate key="journal.issn"}:
				</span>
				<span class="value">
					{$printIssn = $context->getData('printIssn')}
				</span>
			</div>

Best regards,
José Nobre

Use $currentJournal instead of $context if you haven’t assigned the latter to Smarty.

Hi @Vitaliy

I’ve made the change and the error is no longer displayed but the Issn doesn’t show up.

Best regards,
José Nobre

What is the output?
Is print ISSN set for that journal?

Hi @Vitaliy

Both Issn are set as you can see.

issn

Best regards,
José Nobre

What $currentJournal->getData('printIssn') returns?

It doesn’t return anything.
For some reason the added code no longer uses the same style as the published data but i think i can do that myself.

This is the code I’m using.

		{* Published date *}
		{if $issue->getDatePublished()}
			<div class="published">
				<span class="label">
					{translate key="submissions.published"}:
				</span>
				<span class="value">
					{$issue->getDatePublished()|date_format:$dateFormatShort}
				</span>
			</div>
		{/if}
	</div>

		{* ISSN *}
		<div class="published">
			<span class="label">
				{translate key="journal.issn"}:
			</span>
			<span class="value">
				{$printIssn = $currentJournal->getData('printIssn')}
			</span>
		</div>

		{* Publisher *}
		<div class="published">
			<span class="label">
				{translate key="manager.setup.publisher"}:
			</span>
			<span class="value">
				{$publisherName = $currentJournal->getData('publisherInstitution')}
			</span>
		</div>

screenshot

Best regards

I don’t think Smarty allows such variable assignments.
If you aren’t planning to use it later in the template code, just use:

$currentJournal->getData('printIssn')

it will display the value.
Otherwise use assign like in the documentation: {assign} | Smarty

1 Like

Thank you, it now displays the values.

1 Like