Configuration

Nickel's configuration is made up of string, number, and boolean constants in C#.NET, rather than external files. This means better performance and security. For experienced developers this is a cakewalk, but it should also be easy for anyone with a text editor and a hint of experience working with web code.

WARNING!

DO NOT change the contents of the following folders:
  • /App_Code/core
  • /js
  • /Pages
Modifying files in these locations may affect the stability of the application. It's OK to add JavaScript files to the "js" folder to upgrade your HTML template, but do not modify the files from the installation.

App_Code/Settings.cs

Inside your site's "App_Code" folder, you'll find one directory and a few files. The "core" directory is what it implies: the core functionality of the engine. This is off limits. The remaining files are simply definitions of constants that you may, and are encouraged to, update. "Settings.cs" contains important configuration information specific to your site and should be modified. The remaining files all contain strings, or text, that is used throughout the site (eg, error messages, form labels, link titles, etc). We'll go over how to update these values in Personalization.

If you aren't familiar with C#.NET, please read this article on strings in C#.NET before proceeding.

Open Settings.cs" in your favorite code or text editor (Visual Web Developer 2010 Express is recommended). This is the file you needed to open to enter a pass phrase during installation. Each constant has a comment describing its role, but this guide is provided if you're still lost:

This is the text that appears in the bottom module of the right column.
public const string ABOUT = "Information about this site here.";
This is the number of articles that appear is a list before a new page is created.
public const int ARTICLES_PER_PAGE = 5;
When set to true, a date/time stamped copy of the JSON data will made in the "App_Data/backup" directory before any "save" operation (save article, create user, etc). It is highly recommended that you leave this on. If your data is ever corrupted, you can just rename the last backup to "Data.json" and overwrite the active file.
public const bool BACKUP_ENABLED = true;
Change this to the name of the cookie you would like to use for your site. It's not critical to change this, but recommended.
public const string COOKIE_NAME = "MySiteCookieName";
This is a list of images files allowed for upload. When an image is uploaded, a smaller copy (see SMALLIMAGESIZE) will be made. The original can be a wide variety of formats including these listed here, BMP, TIFF, and more. However, it is generally recommended you stick to the web standards: GIF, JPG, and PNG. If you point to file with an extension in this list using the "file" markup tag, it will embed the image.
public static string[] EXT_IMAGE = new string[] { "gif", "jpeg", "jpg", "png" };
This is a list of media files allowed for upload. If you point to file with an extension in this list using the "file" markup tag, it will embed the audio or video.
public static string[] EXT_MEDIA = new string[] { "aif", "aiff", "avi", "mp4", "mpeg", "mpg", "mov", "mp3", "ogg", "wmv", "wav" };
This is a list of files which cannot be served by a web browser allowed for upload. If you point to file with an extension in this list using the "file" markup tag, it will create an "attachment": a link with a paper clip icon.
public static string[] EXT_ATTACHMENT = new string[] { "aspx", "bmp", "c", "cpp", "cs", "css", "h", "hpp", "htm", "html", "js", "swf", "vb", "zip" };
This is the HTML for your site's header. This uses a couple variables. ###url### is replaced with site URL (eg, "http://www.yoursite.com/"). ###title### is replaced with site's name, which is the value of SITE_NAME in this file.
public const string HEADER = "<a href=\"###url###\">###title###</a>";
When this is set to true, the author's name will be linked in the article details. Clicking on the author's name will open a URL which lists all the articles the author has written. It is recommended that you leave this on if your blog has multiple authors. Turn it off if there is only one author.
public static bool LINK_AUTHORS = true;
This is the pass phrase you are using for encryption. You should have already defined this during installation. Once you define this, it should never be changed.
public const string PASS_PHRASE = "";
Set this to true if you wish to allow profile images. All users will be allowed to upload profile photos. Articles will add the author's image by the article details. Comments will contain a tiny image of the poster, if available.
public const bool PROFILE_IMAGE_ENABLED = true;
This is the maximum size of a profile image. Images over this size in either direction will be resized. Profile images are square.
public const int PROFILE_IMAGE_SIZE = 100;
This is the web site description that appears in the meta data by default. Do not enter line breaks here. Quotes, double or single, will be removed.
public const string SITE_DESCRIPTION = "Site description for search engines here";
These are the web site keywords that appears in the meta data by default. Do not enter line breaks here. Quotes, double or single, will be removed.
public const string SITE_KEYWORDS = "keywords, for, search, engines, here";
This is the name of your web site. It appears in your header (if using the ###title### variable in the HEADER property of this document) and in the signature of e-mails.
public const string SITE_NAME = "Site name for header and e-mails";
This is the name of the site owner which appears in e-mail to user.
public const string SITE_OWNER = "My name";
// This is subtitle, or tag line, for your site. This is appended to the end of the page title. Longer, descriptive page titles help in search engine placement.
public const string SITE_TAG_LINE = "Subtitle for site to appear in page title";
// This is the main page title. It always appears first in the title tag.
public const string SITE_TITLE = "Primary page title here";
When an image is uploaded, a smaller copy is automatically made. This is handy when you want to link to a large image in an article by clicking on a smaller image. This value is the maximum size an image may be (either direction) before it gets a resampled copy. Images larger than this will be resized to fit within a square this size. Aspect ratio is preserved.
public const int SMALL_IMAGE_SIZE = 350;

Last edited Nov 9, 2010 at 9:09 PM by BanTheRewind, version 15

Comments

No comments yet.