Installing nc-cms onto your web server

The procedure for installing nc-cms is super easy. It boils down to the following steps.

1. Get nc-cms. If you haven't already, download the latest version of nc-cms from our website. Extract it so you have a clean /nc-cms folder ready on your desktop.

2. Edit the nc-cms config.php file. Open the /nc-cms folder you've just extracted. You will see a file structure similar to the image below. Go ahead and open up the config.php file with your favorite code editor. If you develop on Windows, we personally recommend the slick and fully featured Notepad++.

nc-cms editor button sample.

Be sure to set all of the general settings. If you would like to use nc-cms's database support (optional), set NC_USE_DB to true and configure the database connectivity settings as well.

3. Upload nc-cms to your web server. After saving config.php, upload your now modified /nc-cms folder to your web server. Upload it to where NC_CMS_URL points to from your config.php file. The root of your website domain is recommended (ex: http://www.example.com/nc-cms/).

4. Run the nc-cms database setup (Optional). If you've set up nc-cms's database support in step 2, run setup_database_mysql.php from your web server now. After the database is set up, you may remove setup_database_mysql.php from your web server. However, removal is not necessary as this file poses no security threat.

5. Installation complete! nc-cms should now be fully usable on your web server. Move onto the next section to integrate your first page and see it in action.

Integrating nc-cms into a website page

nc-cms can be integrated into any web page file (.html, .htm, .php, etc.). If you would like to use it with an .html or .htm file, first convert it to .php by changing the file extension. Also be sure to change your internal links to .php where necessary.

Insert the following lines of code into your web page file:

1. Startup. This line initializes the nc-cms system. Insert the following code before your opening <html> tag (or <!DOCTYPE> tag, if it exists).

<?php require('nc-cms/system/start.php'); ?>

It's possible that you may need to change this path depending on where you've uploaded nc-cms.

2. Page Title. This line enables you to edit the page title when logged into nc-cms. Insert the following code inside your <title> tag.

<?php nc_title('custom_name'); ?>

custom_name can be anything you like. Alphanumeric and underscore characters are supported. We personally recommend a naming convention of page_title (ex: home_title, about_title, etc.).

Pro tip: If you'd like another page to use the same title, use the same custom_name.

3. Control Panel Stylesheet. This line includes the css file used by nc-cms. Insert the following code inside of your <head> tag.

<link rel="stylesheet" type="text/css" media="screen" href="<?php nc_get_cp_css_directory(); ?>" />

4. Control Panel. When logged into nc-cms, this will enable the control panel to appear on your page. Insert the following code just after your opening <body> tag.

<?php nc_get_cp(); ?>

5. Editable Content Areas. These lines will place editable content areas. These will display any content assigned to them via custom_name, and when you are logged in, will enable you to edit the assigned content. If the assigned content does not exist, a placeholder will be created automatically. Insert these anywhere in between your <body> tags.

These editable content areas come in two flavours: HTML and String.

The HTML content area is the most common. These areas can contain many paragraphs, images, headers, links and more. Define an HTML area like this:

<?php nc_content_html('custom_name'); ?>

The String content area is used for single lines of text. When used, these are generally placed inline between the header and paragraph tags themselves. Define a String area like this:

<?php nc_content_string('custom_name'); ?>

Again, custom_name can be anything you wish. I personally recommend a naming convention of page_content (ex: home_main, home_sidebar, about_contact, all_copyright etc.).

Pro tip: If you would like to display the same content across multiple pages, use the same custom_name. This is useful for things such as copyright information.

6. Login Link (Optional). You may want to place a link on the page for easy access to the nc-cms login page. If this is the case, use the following line of code.

<?php nc_login_link(); ?>

Or even simpler.

<a href="/nc-cms">Login</a>

7. Integration Complete! That's all there is to know about integrating nc-cms! For those interested in what a completed integration of nc-cms could look like, refer to the sample below. We've also included a sample page in the downloadable package (sample.php).

nc-cms integration sample.

If you have any questions or comments, feel free to post on the nc-cms community forum!

Managing your content using nc-cms

After you have integrated nc-cms into your web page as described in the previous section, you should now be ready to move onto the next step of using nc-cms to manage your content. To start, do the following:

1. Visit Your Website. To use nc-cms you must first visit the page you would like to edit (this is essential, as you will be re-directed here after logging in). Visit the page that you added nc-cms to in the previous section.

2. Login to nc-cms. If you created a login link as described in the previous section, go ahead and click that link now. If not, you can get to the login page by visiting the /nc-cms directory directly (ex: http://www.example.com/nc-cms).

You will be directed to the nc-cms login page. You If you enter your username and password correctly, you will re-directed to the previous page in editor mode.

3. Click an Edit Button. You will notice two things after successfully logging in. A) a new control panel will appear at the top of your page. B) depending on how many editable content areas you added during integration, there will be a number of edit buttons scattered throughout your web page. Click one of these buttons to edit the section associated with it.

nc-cms editor button sample.

4. Edit Your Content and Save. After clicking an edit button you will then be directed to a content editor. Make your changes here and click save. If all has been done correctly, you should be redirected to the previous page, with your changes applied.

5. Logout. When you are done editing, remember to logout. Logging out is essential for preventing unauthorized changes to your website by anyone using the same computer.

Upgrading your nc-cms installation

You may want to upgrade your version of nc-cms down the road. Fortunately, upgrading nc-cms is very easy, clean, and can be done in just a few steps.

1. Back up your settings and content. FTP into your web server. Go to the /nc-cms directory and back up (download) your config.php file and /content directory.

2. Delete the /nc-cms directory and replace it with the new version. Download the latest version of nc-cms from our website. Remove the /nc-cms directory that is currently on your web server. Extract and upload the new /nc-cms folder to the former installation location on your web server.

3. Re-upload your settings and content. Upload your config.php file and /content directory to the new nc-cms installation. Replace as necessary.

4. Upgrade complete! You can confirm your update by logging into nc-cms. The version number is displayed in the top-left of the menu bar. Remember, you may need to explicitly clear your browser cache after the update in order to see all of the changes.

 

Powered by nc-cms