Show current TOC in a custom page

Is there any way to show the current table of content in a custom page?
or insert (smarty?) codes showing TOC in a .html field?
I am using OJS 2.4.8.0

Best wishes,
Romy

Hi @reprabowo,

No, unfortunately, there’s no way to do that without making changes to OJS.

Regards,
Alec Smecher
Public Knowledge Project Team

Greetings @asmecher,

How can I create new custom page with smarty for OJS 3? After creation of tpl file what is the next step?

@Vitaliy, have you considered the static pages plugin?

Hi @ctgraham,

I think it would be better for me to build more complex page, than with tinymce. For example I want to assign classes and other attributes to divs, spans etc. for implementing bootstrap design. It can be done also with jquery, but maybe it can be done with smarty?
I have already modified huge amount of frontend tpl files (with use of child-theme). Or it is too difficult task to create new smarty templates directly?

It’s not a difficult task if you are familiar with PHP and Smarty and are comfortable making local changes to your code.

Generally, URLs map to a page handler under /pages/ where the URL corresponds to the directory name. The index.php file in that directory loads an appropriate handler, and the handler manages the code to display the template.

Consider, for example, the journal index page:
/ojs/index.php/journal/index maps to /pages/index/index.php:

All operations are sent to the index handler:

The index() operation sets up and displays a template such as frontend/pages/indexJournal.tpl:

1 Like

Thanks @ctgraham,

I don`t really know php, but already have some practice with smarty. I see that php syntax is similar with javascript (including OOP), which have already learned.

So after some practice, think would be capable for working with ojs3 php code.

Hi,

At University of Bordeaux, we made some significant changes to OJS2.
We added custom pages with 2 ways. By using the Static Page plugin, when the custom page is built by the editor secretary. And by creating new templates files (tpl) when we needed to use some functions or variables provided by OJS to dispay dynamic informations.
To do that, we created for example for the “About” menu, a new template named “focusScopeub.tpl” which displays only the content of the paragraphe “2.1 Focus and Scope of Journal” of setup 2 of the manager (/manager/setup/2). In the file “pages/about/AboutHandler.inc.php”, we added a function named “focusScope” which calls the template “about/focusScopeub.tpl”. And in the file “pages/about/index.php”, we added in the “switch($op) {” part the following code: “case ‘focusScope’:” We can see this custom page at the following URL: http://<journal.eu>/about/focusScope.

This works fine, but we had to modify the source code of OJS, which does not allow us to do updates of OJS new versions.
Now, we are preparing migration to OJS3. And I was wondering if in OJS3 there is a way to do the same thing but in a custom way without modify original source files.

Thanks in adavance for your answer.
Best Regards.
Helene

Hi @hcl,

We use a mix of approaches with our own hosting services:

  • Wherever possible, we consider whether there is a generally useful and unobtrusive way to add a feature to OJS for inclusion in the next release. This is by far the best solution; when third parties offer contributions, we work with them to prepare the code for merging.
  • When that’s not possible, we add functionality when feasible by writing a custom plugin. This augments OJS functionality without requiring modification of the core files.
  • When that’s not feasible (e.g. because the plugin infrastructure doesn’t easily support a change), we modify the core code, but use git to track these modifications. When the code needs to be upgraded, git can help by tracking and re-applying modifications that were made to the old codebase.

Regards,
Alec Smecher
Public Knowledge Project Team