Latest Issue Template Variable

How Do I get the Latest Issue in Smarty,
I am trying to make an image available site wide.
If I could make the variable available template wide but I can’t seem to
find a way to make it available on every page.

Hi @coopmaster,

You can use TemplateManager::display hook from the theme main class, e.g.

HookRegistry::register('TemplateManager::display',array(&$this, 'assignLatestIssue'));

The method itself would be something like:

public function assignLatestIssue($hookName, $args) {
		$smarty = $args[0];
		$request = $this->getRequest();
		$context = $request->getContext();

		$issueDao = DAORegistry::getDAO('IssueDAO');
		$latestIssue = $issueDao->getCurrent($context->getId());

		$smarty->assign('latestIssue', $latestIssue);
	}