vayu Posted March 30, 2013 Share Posted March 30, 2013 Hi. I am new to PW and spending some time at the moment trying to learn it. One thing I would like to have is a general settings page, a site wide settings page in the admin. A place, the site administrator can store contact info, site title and other general sitewide data info. I know that the Home page could be used for this, but for me this is not the right place for this kind of data. Data stored on the Home page is for the home page only. I would like to have this under the Setup page. What would be a good way to create this kind of settings page? Thanks Vayu 1 Link to comment Share on other sites More sharing options...
pwired Posted March 30, 2013 Share Posted March 30, 2013 Hi vayu, welcome to processwire. Joss made a basic website tutorial. In there he shows you how you can manage Site Settings with a backend template and a site settings page. http://wiki.processwire.com/index.php/Basic_Website_Tutorial (half way the page) Link to comment Share on other sites More sharing options...
ryan Posted March 31, 2013 Share Posted March 31, 2013 You can make any page a settings page. Some of us use the homepage for convenience (since it is the root owner of the pages below it). But you could make your own custom 'settings' template and contain them all there instead if you preferred. I'd also suggest deciding which settings need to be dynamic and which don't. Something like 'site title' may not need to be dynamic. I prefer to store this stuff in $config or with PHP define('key', 'value') calls, either of which you could put in /site/config.php. Link to comment Share on other sites More sharing options...
Samuel Posted April 3, 2013 Share Posted April 3, 2013 Can I set the adminuser and the password in the config.php as well? Link to comment Share on other sites More sharing options...
SiNNuT Posted April 3, 2013 Share Posted April 3, 2013 Can I set the adminuser and the password in the config.php as well? Why would you want to do that? During installation you can choose your desired admin name an password. After that the pass is getting hashed and salted and stored in the db. You shouldn't put stuff like that in a config file (if it's even possible). Link to comment Share on other sites More sharing options...
Samuel Posted April 3, 2013 Share Posted April 3, 2013 Well I would like to .gitignore a file with the admin login credentials, to have a fully automatic gitbased workflow, from where I can push straight to the live/development site, including the mysql database. Have a look at this scenario: http://processwire.com/talk/topic/3229-version-control-for-mysql-via-git-hooks/ Link to comment Share on other sites More sharing options...
ryan Posted April 4, 2013 Share Posted April 4, 2013 Well I would like to .gitignore a file with the admin login credentials, to have a fully automatic gitbased workflow, from where I can push straight to the live/development site, including the mysql database. It sounds like what you want is instead the MySQL login info? If so, you can put it in a .my.cnf file in your home directory: /home/samuel/.my.cnf [client] user=your_mysql_username pass=your_mysql_password Following that you can access the mysql/mysqldump clients without specifying a username or password. This is helpful for automated backups or [i'm guessing] git based workflow. 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