Differences from version 26 to 44

@@ -1,16 +1,19 @@

 This is a BASIC tutorial that will show you how to make a quick package that loops through a table and displays its data. I wrote this because I am starting from the VERY beginning here in bitweaver, and want to make tutorials as I go to help new opensource developers who are joining the project and need a booster seat to sit at the table! I hope it is useful to you!
 Thanks for your help Spiderr
 !!1) Create a New bitweaverPackage
 * Go to the root of your bitweaver installation and make a directory:
-{CODE source='php' num='off'}$ mkdir newPackage
+{CODE source='php' num='off'}
+$ mkdir newPackage
 $ mkdir newPackage/modules
 $ mkdir newPackage/templates{CODE}
 !!2) Create your table
-* In your bitweaver database, create a table called ''test_table'', and add two colums: ''test_table_id'', and ''memo'', or use the sql below
+* In your bitweaver database, create a table called ''test_table'', and add two colums: ''test_table_id'', and ''memo'', or use the sql below. Later we shall see how such tables can be created during plugin installation.
 {CODE source='php' num='off'}-- Note: This first CREATE statement works for postgreSQL
 CREATE TABLE test_table

@@ -61,7 +64,7 @@

 $gBitSystem->registerPackage( $registerHash );
-if( $gBitSystem->isPackageActive( 'eventcal' ) ) {
+if( $gBitSystem->isPackageActive( 'newPackage' ) ) {
  // ... maybe do some initialization stuff if your package is turned on

@@ -76,6 +79,7 @@

+Bitweaver uses the Smarty template engine, enriched with some custom functions. Read more about that on ((Smarty Functions)).
 !!6) Activate your new package
 *Click Administration -> Kernel -> Packages

@@ -86,7 +90,7 @@

 Go to __http://yourbitweaverURL/newPackage/__ and your table should be displayed!
-!!7) Now, create a Module
+!!7a) Now, create a Module
 * To create a module (a little box that you can display in the left or right columns) with a pointer to your awesome new package, we will use the modules directory you created in step 1
 * Create a file using pico, or whatever text editor you use, called ''mod_newPackage.tpl''.
 * The file name must be formated like this so bitweaver can include it in the __Administration / Modules__ dropdown list.

@@ -98,11 +102,36 @@

  <td><a href="{$smarty.const.NEWPACKAGE_PKG_URL}index.php">
- {biticon ipackage=newPackage iname=iconname iexplain="this is a cool icon"}My New Package</a></td>
+ { biticon ipackage=newPackage iname=iconname iexplain="this is a cool icon"}My New Package</a></td>
 (:exclaim:) __$smart.const.whatever_PKG_URL__ is a pointer to a folder called whatever in the root...
 to use icons check out our cool new icon system called ((function_biticon|biticon))
+!!7b) Add menu entries
+Maybe you chose your package be no module. Maybe you have additional functionality that shall plugin into Bitweaver's menu bar. This is a two step procedure.
+First create your templates/menu_newPackage.tpl file with the menu items you want to add.
+{CODE source='php' num='off'}
+ <li><a class="item" href="{$smarty.const.NEWPACKAGE_PKG_URL}index.php">{tr}New Package Home{/tr}</a></li>
+ <li><a class="item" href="{$smarty.const.NEWPACKAGE_PKG_URL}view1.php">{tr}View Something{/tr}</a></li>
+ <li><a class="item" href="{$smarty.const.NEWPACKAGE_PKG_URL}view2.php">{tr}View something else{/tr}</a></li>
+Then register the menu in bit_setup_inc.php.
+{CODE source='php' num='off'}
+if( $gBitSystem->isPackageActive( 'newPackage' ) ) {
+ $menuHash = array(
+ 'package_name' => NEWPACKAGE_PKG_NAME,
+ 'index_url' => NEWPACKAGE_PKG_URL.'index.php',
+ 'menu_template' => 'bitpackage:eventcal/menu_newPackage.tpl',
+ );
+ $gBitSystem->registerAppMenu( $menuHash );
+To read more about menus, read ((Adding YOUR OWN dropdown menu to the Nav bar!)).
 !!8) List of available constants in bitweaver

@@ -116,6 +145,9 @@

 these contain the full path and url to the root of the application
+contains the table name prefix as given in the install script
 contains the name of the currently active package

@@ -130,7 +162,7 @@

 !!9)Make the package installable
 In order to make the package installable, you need an additional directory in newPackage/admin
 {CODE source='php' num='off'}$ mkdir newPackage/admin{CODE}
-and the schema information to chack the database with which comes in the form of a ))''schema_inc.php''(( file
+and the schema information to chack the database with which comes in the form of a schema_inc.php file. In case you want to create columns with other data types, see ((DataDict)).
 The sample for this package is
 {CODE source='php' num='off'}

@@ -159,3 +191,14 @@

 ) );
+To add a nice looking icon besides the package name, simply create an icons folder inside your newpackage directory and drop a file named newpackage.png there.
+!!10)Populate database
+By providing sample data you can populate the database during module install time. See ((Installer Data Pump)) for more information.
+!!11)Further reading
+*Have a look at the ((SamplePackage)) and its explanation ((SamplePackageDissection)).
+*If you want to add automated testing, read ((TestingSuites)).
+*Become a template whizard by reading ((Smarty Functions)).
+*Think of sorting your list results? Consider using ((function_smartlink)) as column header.
+*Missing: Search integration. How does the search engine know about the new tables?
Page History
14 Jan 2007 (13:14 UTC)
Add reference for testing
Current • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
Sean Lee71.241.129.17423
View • Compare • Difference • Source
View • Compare • Difference • Source
Sean Lee71.241.129.17421
View • Compare • Difference • Source
Jan Lindåker81.229.122.24919
View • Compare • Difference • Source
Simon Benedicic193.77.101.1418
View • Compare • Difference • Source
Lester Caine81.138.11.13617
View • Compare • Difference • Source
Lester Caine81.138.11.13616
View • Compare • Difference • Source