@byte Posted June 22, 2016 Share Posted June 22, 2016 Hi, i am new to processwire and trying to setup a simple homepage. I am allmost done with and it works god so far. Now i want to use a statistik-script on my page. I copyed all file to a subdir under site/templates/stat/. But i get no access to that subfolder under processwire to install the script. Also i need access to that script for counting and have the user set a opt-out cokkie. How can i get access to files in that subfolder? Thanks in advance for help! Link to comment Share on other sites More sharing options...
blynx Posted June 22, 2016 Share Posted June 22, 2016 Hi and welcome here! What kind of 'script' ist that? Is it a complete application like Piwik? https://piwik.org or a GoogleAnalytics code? Or is it a simple php/js script? Would you share a link so we could have a look how that is supposed to work? cheers! Steffen Link to comment Share on other sites More sharing options...
adrian Posted June 22, 2016 Share Posted June 22, 2016 For security reasons you can't directly access php files under site/templates. You will either need to put it in the root of your site, or create a page in the admin page tree and assign it a template that is linked to the required php file. 2 Link to comment Share on other sites More sharing options...
LostKobrakai Posted June 22, 2016 Share Posted June 22, 2016 Any non-pw code does not need to go into the templates folder. Just put it in a subfolder of your root directory and it should be installable. Link to comment Share on other sites More sharing options...
@byte Posted June 22, 2016 Author Share Posted June 22, 2016 The Statistik-Script is PHP-Web-Stat. I copyed all files to the root/stat/ now and it works. Thanks a lot for your quick replys. So if i want to include a file in a template from there it schould be include("../stat/config/tracking_code.php"); Link to comment Share on other sites More sharing options...
adrian Posted June 22, 2016 Share Posted June 22, 2016 I would go for: require_once($config->paths->root . 'stat/config/tracking_code.php'); 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now