Building Themes for MongoPress | The MongoDB CMS - High-Performance NoSQL Web Management

Building Themes for MongoPress


The only required files are as follows:

  • index.php - this is used when no object can be associated with the URL from the required my_get_header() function
  • single.php - this is used when an object can be associated with the URL using the required my_get_header() function
  • css/style.css - this is the file that will get included into the header

As such, the simplest theme imaginable might look like:

/* index.php */

mp_get_header(); // Without this, the clouds will fall from the sky...
$object_format = array(
     'type' => 'content',
     'style' => 'article',
     'order_by' => 'created',
     'order' => 'desc'
);
mp_content($object_format);
mp_get_footer(); // Without this, the clouds will fall from the sky...

/* END OF index.php */

/* single.php */

mp_get_header(); // Without this, the clouds will fall from the sky...
$object_format = array(
     'type' => false,
     'style' => 'single',
     'can_query' => true
);
mp_content($object_format);
mp_get_footer(); // Without this, the clouds will fall from the sky...

/* END OF single.php */

/* REQUIRED CSS */

article {}
article header {}
h3.article-title {}
article section.content {}

However, it is recommended that you also include the following folders:

  • admin - this is used to display views for administration pages - more information will be available on this within the next release
  • content - this is used to directly import HTML content and set-up the structure of the installation or transport objects around different environments

It is also worth noting that functions.php will automatically get included if provided, much the same as with WordPress. In addition, and until better more explanative documentation is in-place, you should seriously consider looking into and or utilizing the following functions and features:

  • Perma-Trails - these provide powerful tools that can be baked into the design
  • content templates - we can't continue stressing enough how useful content templates can be!
  • mingo_meantime() - there is more to this than meets the eye!
  • mp_content_block() - this allows you to create a block of content that automatically gets hooks and filters applied to it
  • mp_get_media() - this allows you to retrieve and format images and ZIP files from MongoDB GridFS directly to and through your browser
  • get_template_part() - very similar to its WordPress counter-part
  • _e('to echo') and __('to return') - exactly the same as the WordPress language API
  • add_action() and add_filter() - also exactly the same as the WordPress plugin API
  • jQuery and Adaptive Design - HTML classes (eg. < html class="mozilla lt-1024" > ) get added to all pages showing browser vendors and current screen-widths. In addition to this, jQuery is also included on every page...

Download MongoPress 0.2.3

AJAX Rocket Ready for Launch - Are You...?

Download
MongoPress 0.2.3
Download MongoPress 0.2.3

downloaded 6,044 times and counting


SVN MP 0.2.3 or SVN Nightly Build

Proudly Powered by MongoPress - The MongoDB CMS - High-Performance NoSQL Web Management - Developed by Laulima