Get issue id in page - options "Current issue"

Hi!
Is it possible to in smarty tpl to get issue id which set in backend “Current Issue”?

image

Thanks in advance!

Hi @E-GOR,

We need a few more details clarified here:

  1. Can you elaborate on what you’re trying to achieve here - is it to set the issue to the current issue? Or, am I misunderstanding? If you could elaborate further, that would be helpful.

  2. Can you tell us which version of OJS you’re using?

Best regards,

Roger
PKP Team

Hello.
OJS 3.1.1.0
I want to redesign frontend templates for a better experience.
I would like control any url links on the main and other pages with navigation to current issue.
Since some issues can have status - “in progress” or “in work” (not final publications), but have a last date.
Exapmle:
href="{url page="issue" op="view" path=$issue->$Сurrent }">{translate key=""}
Where $Сurrent = id
Get id and use smarty variable?
Thanks for the answer

From your custom theme, you would need to get the current issue ID and pass it to each template. The Theming Guide has a section on how to pass data to the templates.

In your case, you would want something like this:

// Get the journal
$context = Application::get()->getRequest()->getContext();

// Get the current issue
$issue = $issueDao->getCurrent($context->getId());

// Assign the issue to the template
$templateMgr->assign('currentIssue' => $issue);

Then in your template you can use:

{$currentIssue->getId()}