Jump to content

How can i changed template path?


Recommended Posts


I create a directory structure inside the main template directory.

So, the templates are inside a directory called pages.


But when I create a template from the admin, I get an error saying ProcessTemplate: No new template files were found in: /geointranet/site/templates/*.php. How can that core path be modified? It's possible?

Thanks to everyone!

Link to comment
Share on other sites

Thanks @3fingers

I tried to enter this condition

if($user->hasRole('superuser')) {
//or the same example
if($user->name =='username') {

in both _init.php and config.php, and it still doesn't work. I do not know what I'm doing wrong.

Link to comment
Share on other sites

3 hours ago, sebafurfaro said:

in both _init.php and config.php, and it still doesn't work

You can't do it in those files, use init.php instead, as opposed to _init.php. The latter is just a convention and often used like this:

 * _init.php initializes variables output in _main.php
 * This file is automatically prepended to all template files as a result of:
 * $config->prependTemplateFile = '_init.php'; in /site/config.php.
 * Automatic inclusion for any given template can be disabled:
 * in admin: Setup > Templates > [some-template] -> "Files" tab -> "Disable automatic prepend file".

In config.php the user is not yet known, as it runs before PW populates the $user and other API variables. 

Link to comment
Share on other sites

I moved the snippet to the init.php file and I get this error:


I tried the same example from here 


And I get the same error. So, I tried this one:

$config->setLocation('templates', 'site/templates/pages/');

& this one:


For the last one, I move the directory pages into site, but the error is the same.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...