Search for Resources and Solutions

Midrub Frontend Theme Structure

In this article i'm going to describe the Frontend Themes in Midrub. These themes are more advanced than Admin Themes or User Themes. 

Midrub Themes has two locations, but don't worry because with automatic installation you won't take care about. Also, i'm going to add automatic updates even for themes and any theme author will be able to provide updates.

To create a theme:

  • Create a new directory here application/base/frontend/themes.
  • Inside the theme directory create config.json with this value:



{
  "name": "",
  "description": "",
  "version": ""
}

  • Create the directory contents.
  • Inside the directory contents create the directory templates.
  • Inside the directory templates create any php file you want with any content.
  • Return to main theme directory and create the directory core.
  • Inside the directory core, create 3 directories: ajax, hooks and inc.
  • Inside the directory hooks, create any php file and inside add this code:

set_contents_category(
    'theme_pages',
    array(
        'category_name' => 'Pages',
        'category_icon' => '',
        'editor' => true,
        'slug_in_url' => false,
        'templates_path' => the_theme_path() . 'contents/templates/',
        'words_list' => array(
            'new_content' => 'New Page',
            'search_content' => 'Search for pages',
            'enter_content_title' => 'Enter the page title'
        )
    )
);

  • Create a new directory here assets/base/frontend/themes with your theme's name.
  • Add a png image with the name screenshot and resolution 640x326 and your theme is ready.
  • Go to Midrub -> Admin -> Frontend -> Pages -> New Page.
  • Create a new page.
  • Click on Frontend Settings and select the created page as Home Page.


As i said this is a basic guide which works from Midrub 0.0.7.9 final. 


Was this article helpful?