How can I print (see) the tpl that a page is using?

Describe the issue or problem
I am designing and modifying a theme and it would help me a lot if when viewing a page, it would show me which .tpl files the theme uses on that page.

Is there a way to show them while developing a theme?

What application are you using?
OJS 3.4.0.3

Hi @Koffer,

I don’t know if there is a way to display the specific template (@Vitaliy - do you know?), but we do provide some advice on how template files interact with files and are structured: https://docs.pkp.sfu.ca/pkp-theming-guide/en/html-smarty#locating-the-frontend-templates (if you haven’t seen this already).

-Roger
PKP Team

1 Like

Thanks for the response and for the link to the documentation. I have already identified several of the general .tpl files on the theme, I think I need to discover the use of some more specific ones.

The idea of printing them was to have a guide in place, but still there are not so many files.

Hello @Koffer,

It would be nice to have this feature for devs.

My workaround to have something similar is to have a hook like:

Hook::add('TemplateManager::display', [$this, 'handleTemplates']);
Hook::add('TemplateManager::fetch'  , [$this, 'handleTemplates']);

Then in ‘handleTemplates’ I print or break in debugger. However, this hook will NOT be activated when a template include another one like {include file="frontend/objects/article_summary.tpl"}. Hope it helps you, but I guess you need deeper info.