OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Retrieve Table of Contents on Article page

OJS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page.

Git: You can access our public Git Repository here. Comprehensive Git usage instructions are available on the wiki.

Bugzilla: You can access our Bugzilla report tracker here.

Search: You can use our Google Custom Search to search across our main website, the support forum, and Bugzilla.

Questions and discussion are welcome, but if you have a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a technical support question, try the OJS Technical Support subforum.

Retrieve Table of Contents on Article page

Postby bgarnicnig » Mon May 13, 2013 4:01 pm

Hello,
I'm trying to render the relevant Table of Contents on the article page (article.tpl), in an abbreviated version. I was wondering if any of you could help me find which variables/objects I could call to retrieve an array/object containing the ToC, similar to what happens in

Code: Select all
{foreach name=sections from=$publishedArticles item=section key=sectionId}

in templates/issue/issue.tpl

simply including
Code: Select all
{include file="issue/issue.tpl"}
doesnt seem to do the trick...

cheers,
bernhard
bgarnicnig
 
Posts: 7
Joined: Sun Nov 07, 2010 10:01 am

Re: Retrieve Table of Contents on Article page

Postby asmecher » Tue May 14, 2013 10:24 am

Hi Bernhard,

The problem is that the variables you're referencing in Smarty haven't been assigned by the PHP code that supports that template. The $publishedArticles variable is assigned for use in the issue template in pages/issue/IssueHandler.inc.php; look at the code surrounding the line:
Code: Select all
$templateMgr->assign_by_ref('publishedArticles', $publishedArticles);
To get access to $publishedArticles in the article view, you'll have to expose that variable in the PHP code prepping the article template, which will be in pages/article/ArticleHandler.inc.php.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9072
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Development

Who is online

Users browsing this forum: No registered users and 2 guests