meek/mēk/

Adjective: Quiet, gentle, and easily imposed on; submissive
 
 

Goal

Usually when you deal with a CMS system you are working within the constraints of what that system allows you to do. For lots of uses this works really well, you create a site full of content and add a plugin for a common feature you want added to the site. Meek takes this approach and reverses it, as developers we commonly create a custom application for a customer, and then they need the ability to manage a limited set of content within it.

Then it is up to you to create a simple way to manage some content and images within you application. Using the Microsoft MVC framework and the Razor or ASPX view engine Meek makes this task as simple as adding single assembly reference and a web.config entry.

Capabilities

  • Create and maintain pages via wiki style usability
  • Create and maintain partial page content
  • Upload images
  • Built in CKEditor
  • web.config setup or code based setup
  • Delpoyable via Nuget
  • Built-in InMemory, SQL, FileSystem, or custom storage
  • C# or VB project compatablity
  • Works under medium trust
  • Uses your own layout

How to use

Create content

To create a new page you can simply type in the browser a url that does not exist and if you are a content admin it will give you a screen to create it.

To create partial content you can follow the same method and then add the code in the view to reference it. Or if you do not have any content to start, when you add the code in the view to the partial content it will give a content admin a link to create it.

To add the code in the view for a partial view you use a Html helper method, either called fully qualified or if you add the namespace for the razor view engine in the View/web.config.

 

<add namespace="Meek.HtmlHelpers"/>

 

Then it is as simple as adding @{Html.RenderRoute("A/Partial/Page");} right in the view where you want it to show up.

To add images to content it uses the built in features of CKEditor, you can click the image feature and use the upload tab to add images and the browser server button to select images.

Editing content

To edit content you can either go directly to the same url used to create it or by browsing the site as a content admin both full and partial pages will display a link to edit the content. Or to view all content currently defined in Meek go to the url /Meek/List and it will provide you the list of links to edit any content available.

Assumptions

Your MVC3 application is using the _Viewstart file to set the default layout, if not then the custom content will not have your layout. The title property created for full pages populates the ViewBag.Title property so you need to use this in your layout to set the browser page title.

These are the current required assumptions and may be configurable later to support more custom configuration options.

Installation

Meek is available from NuGet or by building from source from its GitHub repository
If installing from NuGet it has a dependency on WebActivator to handle initalization, if you wish to avoid this you can reference the Meek.dll only and place the Meek.BootStrapper.Initialize() inside your own Application_Start (must be post route registration).

Configuration

Meek supports configuration via web.config, directly from code or a combination of both.
Both still require you to call the Meek.BootStrapper.Initialize() method on the application startup.

web.config configuration

To use the web.config you first need to add the section…

 

<section name="meek" type="Meek.Configuration.MeekConfigurationSection, Meek" requirePermission="false"/>

 

Below is the most basic configuration possible (and what is used if installed from NuGet)

<meek>
  <repository type="InMemory" />
</meek>

This enables the InMemory repository which is great for testing but obviously looses state when the application is unloaded.

The other two types of built in repositories are "Sql" and "FileSystem", when using these two you must also supply a source="" attribute. In the case of Sql it will expect that to be a connection string name defined in the <connectionStrings>, and if using the FileSystem it will expect an existing folder name.

With this basic setup everybody has access to manage content which is obviously not ideal, so you can define roles to uses.

<meek altManageContentRoute="Missing">
  <repository type="InMemory" />
  <contentAdmin>
    <add role="Content Admin"/>
  </contentAdmin>
</meek>
There are a few more settings currently available.
<meek altManageContentRoute="Missing" notFoundView="NotFound" ckEditorPath="CustomCKEditor">

 

 

 

Two are used for a customized experience when using the wiki style page creation, altManageContentRoute allows to to define an special route that Meek will listen on to manage content and the notFoundView is for displaying a custom 404 view.
ckEditorPath is used if you have a custom CKEditor that you would like to use instead of the built-in.

To enable the wiki style page creating you need to need to configure the 404 custom error page to either /Meek/Manage or to the altManageContentRoute value.

<customErrors mode="On">
  <error statusCode="404" redirect="/Missing"/>
</customErrors>

To use the notFoundView you can create your custom 404 view in the /Views/Shared folder where the MVC framework will naturally pick it up.

code configuration

If you wish to customize the configuration to your own needs you can use the overloads on the Meek.BootStrapper.Initialize() method.

You can supply the values for altMnageContentRoute, notFoundView, and ckEditorPath.

There are three services you are able to change Repository, Authorization, and ImageResizer.
To override any of these you need to use the MVC3 built in DependencyResolver to supply a implementation for the interface.
If you wish more control then you can use the overload to supply a replacement implementation for the meek service locator.

A basic example of how to use Unity and the MVC3 DependencyResolver you can download the source and look at the test application/ It manually defines the InMemory repository so it may create a default state for the automated tests.

Connect With Us

     

Contact Us

Toll Free: (888) 373-8718
Main: (913) 402-9600
Fax: (913) 402-9603
7450 W. 130th Street
Suite 320
Overland Park, KS 66213

Upcoming events

  • Events on May 16, 2013

    LWS Lunch

    Starts: May 16, 2013, 11:30 am

    Ends: May 16, 2013, 1:00 pm

    Location: DEG Offices

  • Events on June 18, 2013

    Kanban Training

    Starts: June 18, 2013, 12:00 am

    Ends: June 20, 2013, 12:00 am

  • Events on June 20, 2013

    LWS Lunch

    Starts: June 20, 2013, 11:30 am

    Ends: June 20, 2013, 1:00 pm

    Location: DEG Offices

  • Events on July 18, 2013

    LWS Lunch

    Starts: July 18, 2013, 11:30 am

    Ends: July 18, 2013, 1:00 pm

    Location: DEG Offices

  • Events on August 15, 2013

    LWS Lunch

    Starts: August 15, 2013, 11:30 am

    Ends: August 15, 2013, 1:00 pm

    Location: DEG Offices

  • Events on September 19, 2013

    LWS Lunch

    Starts: September 19, 2013, 11:30 am

    Ends: September 19, 2013, 1:00 pm

    Location: DEG Offices

  • Events on October 17, 2013

    LWS Lunch

    Starts: October 17, 2013, 11:30 am

    Ends: October 17, 2013, 1:00 pm

    Location: DEG Offices

  • Events on November 21, 2013

    LWS Lunch

    Starts: November 21, 2013, 11:30 am

    Ends: November 21, 2013, 1:00 pm

    Location: DEG Offices

  • Events on December 19, 2013

    LWS Lunch

    Starts: December 19, 2013, 11:30 am

    Ends: December 19, 2013, 1:00 pm

    Location: DEG Offices

  • Events on January 16, 2014

    LWS Lunch

    Starts: January 16, 2014, 11:30 am

    Ends: January 16, 2014, 1:00 pm

    Location: DEG Offices

  • Events on February 20, 2014

    LWS Lunch

    Starts: February 20, 2014, 11:30 am

    Ends: February 20, 2014, 1:00 pm

    Location: DEG Offices

  • Events on March 20, 2014

    LWS Lunch

    Starts: March 20, 2014, 11:30 am

    Ends: March 20, 2014, 1:00 pm

    Location: DEG Offices

  • Events on April 17, 2014

    LWS Lunch

    Starts: April 17, 2014, 11:30 am

    Ends: April 17, 2014, 1:00 pm

    Location: DEG Offices

  • Events on May 15, 2014

    LWS Lunch

    Starts: May 15, 2014, 11:30 am

    Ends: May 15, 2014, 1:00 pm

    Location: DEG Offices

Recent tweets