So far we have coded all the necessary class files.
Here we will create our first module 'home'.Before creating our first module,let us add two more functions in 'functions.php' in 'main' folder.
The homepage of our site will contain a register form and login form.
Homepage is theme based .
Open the 'default' themes folder and create 'homepage.php'.
Edit this file with your contents.
Homepage should be simple and attractive.
Download the theme with new homepage from the link below as an example.
Download default theme
Creating the first module
Home module doesn't require the necessary files to be valid.
It is valid by default.The home module, we are going to create will have only two files.
Create a folder and name it as 'home'.
Create two files as mentioned above.
view.php
Here we will create our first module 'home'.Before creating our first module,let us add two more functions in 'functions.php' in 'main' folder.
/*************************** Builds menu (left) $menu argument must be an array ****************************/ function build_menu($menu) { foreach ($menu as $name=>$link) { show_menu($name,BASE.$link); } }
build_menu function is used to build a menu for navigation.It accepts an array $menu as parameter with key indicating the name of the menu and value indicating the link.
Now add another function to show the menu./*************************** Shows the menu ****************************/ function show_menu($name,$link) { echo '<a href="'.$link.'" class="left_menu">'.$name.'</a>'; }Creating the homepage
The homepage of our site will contain a register form and login form.
Homepage is theme based .
Open the 'default' themes folder and create 'homepage.php'.
Edit this file with your contents.
Homepage should be simple and attractive.
Download the theme with new homepage from the link below as an example.
Download default theme
Creating the first module
Home module doesn't require the necessary files to be valid.
It is valid by default.The home module, we are going to create will have only two files.
- view.php - content in app_block area.
- left_menu.php - menu for navigation.
Create a folder and name it as 'home'.
Create two files as mentioned above.
view.php
You can write whatever here to meet your requirements.
You might love this quote!!! <div class="content_wrapper"> <h3> "We've demonstrated a strong track record of being very disciplined with the use of our cash. We don't let it burn a hole in our pocket, we don't allow it to motivate us to do stupid acquisitions. And so I think that we'd like to continue to keep our powder dry, because we do feel that there are one or more strategic opportunities in the future." -- </h3> </div> <h2> <a href="http://www.blogger.com/blogger.g?blogID=5175690629178451362">Steve Jobs </a></h2>
left_menu.php
<div id="left_menu"> $menu = array('Photos'=>'/#','Videos'=>'/#'); build_menu($menu); if(is_admin()) { echo '<a class="left_menu" href="http://www.blogger.com/'.BASE.'/admin/">Admin</a>'; } ?>
Navigation is created using the two functions we created in the begining of this post.