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.
Suggested Articles
- How to update the frontend themes
- How to change the favicon in the default Frontend's theme
- How to change the logo in the frontend's default theme
- How to install a frontend theme
- get_pagination - displays pagination for contents
- the_pagination - create a pagination as you need
- the_db_request in midrub frontend themes
- Get the theme's path in a Midrub Theme
- How to use the text from laguage files in a Midrub's theme
- How to use the code which should be used in more theme's files