BUCKHORN Posted October 8, 2013 Posted October 8, 2013 Hi, I can't seem to find a variable that would point me to the site profile folder. Need to create path to: root/site/new_folder the vars that I'm aware of only point to folders within templates. e.g. root/site/assets root/site/modules root/site/templates etc., but I can't find one for... root/site root/site-two (in the case of core multi site) I know I can can simply remove the last part of the templates path, but there's got to be a cleaner way to do this, or Ryan did this intentionally to enforce the htaccess protection of php files inside the templates directory. (i probably just answered my question and will have to put my folder inside of templates)
teppo Posted October 8, 2013 Posted October 8, 2013 Sounds like you're looking for $config->paths->site. 1
BUCKHORN Posted October 8, 2013 Author Posted October 8, 2013 Yes, does that exist? No mention of it in the docs. Thanks!
BUCKHORN Posted October 8, 2013 Author Posted October 8, 2013 Tried that, and yeah, doesn't seem to exist for me (not in var_dump). I'm using the most recent production version of PW.
SiNNuT Posted October 8, 2013 Posted October 8, 2013 maybe $config->paths->root ?? Path to your site root directory in ProcessWire.
BUCKHORN Posted October 8, 2013 Author Posted October 8, 2013 Thanks guys! Nothing listed in cheatsheet for this variable. I thought about using $config->paths->root, however the site folder name is variable (as in the case of multi site), so I'm not sure how to find the variable name of the site folder to append to $config->paths->root. For example, my module wants a path to "site" for the default website and "site-website1" or "site-site2" or "site-whatever-i-name-this" in the case of multi-site. Maybe I have to use the config variable set in index-config.php, but I can't figure out how to access it. I know I can just use $config->paths->templates to get the site directory name, but it just seems to me that there ought to be something like what Teppo had mentioned... $config->paths->site.
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