Skip to content

Configuration

@iDoMeteor edited this page Mar 2, 2016 · 6 revisions

SrslY!?

Do you have to grok all this & config for half an hour before you use OPW?? NO!

But, if you are going to deploy it and use it for a real site.. then you definitely should at least change the meta tags, title & images!

Configuration Load Order

Currently, the configuration system is not quite complete. However, it does work quite well using 2 & 3 from below!

  1. Persistent & Preferred: Read from database (this is not currently implemented)
  2. Run-Time Settings: Meteor settings, JSON file
  3. Static Defaults: idometeor:opw-core/lib/defaults.js

Values will be loaded from the first place it finds one. Only values defined in the defaults.js file are valid, all others will be ignored.

The real-time configuration editor is coming ASAP.

Secure by Default

#OnePageWonder uses strict access control origins and, if using the scaffold install, browser policies. Read the basic security section for details.

Debug by Default

The difference between defaults.js & settings-default.json is that debug and client-side console messages are disabled in the settings file, so if you wish to eliminate the console noise, launch with meteor --settings settings-default.json.

This is sort of an indicator that you should probably be launching with --settings. :>

Setting Configuration Values

Copy settings-default.json to settings-yoursitename.json and carefully edit the values as you wish and then launch Meteor using --settings.

$ meteor --settings settings-yoursitename.json

If you edit the settings file, I highly suggest that you lint it afterwards with jsonlint.

Values and Their Effects

There are a ton! Several are not yet implemented, the best way to know what's up is to read the actual config.js comments. However, I will also detail them below by section.

CORS Access Control Origin

This sets the list of sites allowed to do trixy XSS stuff (ie; letting Meteor talk to itself). If you deploy this anywhere but localhost or an x.meteor.com address, you will need to add it (and possibly externally loaded resources, say from CDNs & such) into this comma separated list.

Bootstrap

The Twitter Bootstrap options control the default behavior of the alerts and carousels. They can be overridden when called. The default duration an alert will stay on screen is 7 seconds and the background color will be assigned the Bootstrap 'info' context. The carousel defaults to 6 seconds between slide changes.

Contact

This sets a variety of strings used by the contact system. The most important to change are the from and recips properties. This will ensure that emails sent from your #OnePageWonder install will look like they are coming from you, or being sent to you, as appropriate.

  • from should be a single valid email address
  • recips should be a single comma separated string of valid email addresses

Log

This controls the fairly sophisticated #OnePageWonder logging system.

  • clientSideConsoleLogs determines whether or not OPW will send any console messages to the client. It does not affect start up messages
  • debug will output tons of useful data to the console (only on server if above is false) which essentially tracks the state of OPW as it changes
  • logLogs will log all but debug messages to the opwLogs collection, I have not had a chance to study the performance implications of this under load

Footer

The footer section of #OnePageWonder is quite configurable, as you will see below.

  • contextClass determines the Bootstrap contextual background class, should be one of: primary, info, danger, warning, success
  • fixed determines whether or not the footer remains on screen while a user scrolls the content area, or only appears when a user has scrolled to the end of the page
  • show determines whether or not the footer is shown at all (note: if you have more than one section and the footer is not showing and the scroll indicator is set to display in the footer, you may as well disable the scroll indicator)
  • fluid adds the 'container-fluid' class to the footer section tag when set to true, otherwise it will just get the standard 'container' class

Google

Native Google Analytics support has temporarily been removed because it became buggy while I was on hiatus.

  • account is your full user agent indentifier (UA-XXXXXX-XX)
  • cookie fields allow you to customize your cookie, it is auto-configured by default
  • debug will load and use analytics-debug.js from Google rather than just analytics.js
  • debugTrace will do the same, and also output an insane amount of debugging info
  • enable is pretty self-explanatory
  • sendLogEvents will send relevant events passing through OPW.log to your GA
  • trackInPage is not yet integrated
  • trackInterests is also not yet integrated

Images

These properties currently just tell OPW where to find the main site logo & the OPW footer logo. All images need to live somewhere in public/.

  • logoAbs is the absolute URI for your site's full-sized logo image, which you should typically copy over top of public/logo.png, but you can put it anywhere you like.. as long as it's in public/*
  • logoRel is where the image from above lives, relative to public/
  • logoNavigationAbs used by the navigation system (ie; home link), with default layout & CSS it should be 24px high
  • logoNavigationRel same as above, but relative to public/

Kadira

If you want to use Kadira to profile your OPW install, it's all set to go! Just add your key & secret, set enable to true and let'er rip!

Layout

Currently, only the 'fluid' option has any effect. It determines whether each section gets a Bootstrap 'container' or 'container-fluid' class.

When Bootstrap 4, Materialize & Polymer support are added, you will be able to select which one you prefer to use here.

Linter

The OPW global interface provides a bootlint() method which is only run if you enter OPW.bootlint() in the browser console. It will download the latest Twitter Bootstrap linter directly from them and run it against your site, appending the results to the bottom of the page. It's pretty awesome.

  • requireLogin set to true will only allow the administrator to run this, while setting it to false will allow any anonymous user to do so (basically just for me to show off, lol)

Meta

OPW, being the robust CMS that it is, provides an extensive set of meta tag properties. You will want to modify anything title/description/keyword/image oriented, but the rest you can probably leave alone. There are several duplicate title/description/etc fields because we are setting tags for Facebook, Twitter, etc. Anything you don't customize will show OPW defaults when shared, so you should definitely deal with them. Kind of a PIA, but better than not having them!

These tags will be injected into your HTML before all the Meteor garbly gook, nicely separated by newlines for prying eyes.

Navigation

The navigational system in #OnePageWonder is pretty simple, from the user point of view. However, from my point of view.. it is quite complex! One important think to know is that for now, only horizontal navigation style is supported. Next version will also have vertical (and maybe #MeteorPress style), and two versions from now will incorporate #MeteorPress style and a super awesome surprise style!

Also, the dynamic theme & navigation features are not currently implemented, since there is only one navigation style and you must manually change themes. :O

General

  • allowDynamicTheme when incorporated, and set to true, this will allow anonymous users to click a button to rotate through themes that you have enabled
  • allowDynamicNavigation when incorporated, and set to true, this will allow anonymous users to click a button to rotate through the various navigation styles (here I am flossin' again)
  • collapse will slightly collapse the height of the navigation header when the user scrolls away from the top of the page
  • collapseOffset determines how many pixels away from the top the user must scroll to trigger the collapse
  • contextClass has two valid options, 'default' or 'inverted', which are standard Bootstrap options that affect the contextual BG & FG colors in the header & footer
  • fixed when set to true, the header will always stay on-screen, setting it to false will allow it to scroll with the content
  • fluid determines whether the head navigation section will have the 'container' or 'container-fluid' class applied

Scroll Indicator

The scroll indicator will never be shown if there is only one section.

  • fixedScrollIndicator determines whether to place the scroll indicator in the footer (fixed) or at the end of each section
  • scrollStyle is not yet integrated, the next version will have additional options which will allow the scroll indicator function in one of three modes; scroll-to-next & back-to-top, next/previous, and top/previous/next/bottom
  • showScrollIndicator will never show the scroll indicator if set to false

Style

  • style will be integrated in the next version and is the toggle for horizontal/vertical/etc

Numerics

Pretty much all dynamic numerical values live here and are mostly used to limit various features.

  • maxContactRequestsPerIp allows multiple contact requests from the same IP address as long as the user enters a unique email address or Twitter handle, which will prevent people in the same location (ie; cafe, conference, etc) from being blocked unnecessarily but also deter spammers
  • menuItemMaxCount limits the number of rows fetched from the database, regardless of how many there are (ie; don't let the content editor break your design! :D)
  • menuItemMaxLength affects the editor's title input field (and the insertRow method) max length
  • navTitle setting this lower than above will trim navigation titles regardless of how long they actually are, setting it to 0 will disable the feature
  • publishLimit default publish limit for any query that is not dynamically assigned, or functions as the default when not passing a dynamic limit

Prefix

This is the prefix used to name the mongo collection (not the Meteor collections, those are static). Defaults to 'opw', so your collection names will be like 'opw-rows', 'opw-log', etc

Rollbar

Rollbar has not yet been implemented, it should appear alongside native GA support in version PR.2

Title

This is the only string that OPW will use to define your site title throughout the system, aside from in the meta tags (hopefully I can consolidate all that junk when I get it using the DB config)

Social

Currently configures a couple of links in the site footer. Next version will see some additions here, such as: Facebook, Google, etc. You can disable each link separately by setting the string to ''.

  • enable determines whether or not to output the links, regardless if they are set or not
  • github should be a link to your GitHub profile or project page
  • twitter should link to the relevant Twitter profile

Strings

Many of the user-facing strings are configurable here. The goal is to eventually have all strings here and utilize this area for multi-lingual support. There are a bunch, they are named pretty explicitly, so I'll let you figure those out for now.

Toggles

Simple set of true/false settings that are not really dependent on other sections.

  • logSectionViews determines whether or not to increment section views when a user scrolls to it (activated via Bootstrap scroll spy) and if your site is getting hammered you may want to disable it
  • notifyAdminOnLoginSuccess will put login successes in the Admin Notification Log and probably send an email as well
  • notifyAdminOnLoginSuccess will put login failures in the Admin Notification Log and probably send an

WonderBar

This will probably acquire some more options eventually.

  • helpTitle sets the title of the #OnePageWonder help modal

Clone this wiki locally