Jump to content

Howto create a general settings page


vayu
 Share

Recommended Posts

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

  • Like 1
Link to comment
Share on other sites

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

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

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

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
 Share

×
×
  • Create New...