Creating a database-driven Application with Aiki

From Aikiframework wiki

Jump to: navigation, search

Contents

Install Aiki

  1. Set up database (setup one database, user etc.)
  2. Make certain mod_rewrite is enabled (it is most of the time.)
  3. Chmod all aiki docs to 777 (do this to your html/www folder if you have to

Creating a div site structure

    1. Setup a widget named "page" as the main container.
    2. Make this widget a "Father" - set 'is father' to 'Yes.'
    3. Put main site styles here, you may go back later to add. Change the render order of page to 1.
    1. Setup a widget named header, as a 'header' widget type,
    2. Set 'father' to 'page'.
    3. Add content that you wish to appear in the widget in the content field.
    4. Change render order to 2.
    1. Repeat above for the navigation, footer and other widgets that define your main site layout. Give each widget a unique number that corresponds to your desired render order.
    2. Set the render order of the footer widget to a very high number (100) incase you need to add other widgets that you want to appear between the footer/header.

Defining URLs

  • The default url is homepage, we can start by opening the page widget, and adding 'homepage' to the Display URLs.
    • Do this for each of the other child widgets to page (header,nav,footer)
  • You may add other URLs to each widget as they are created by adding a '|' (thats the pipe character) to the end, example:
homepage|news|other

Defining Site Pages

This will go through how to create a widget to put within your div structure to display data.

  1. Create a new widget
  2. define a 'Display URL'
  3. set its father to "page"
  4. set its render order to a number higher than the div that precedes it, and lower than the render order of the footer. Example: 'page' widget = 1 , 'header' = 2, 'nav'=3, footer='10', so we would set this to '4'.
  5. Add desired information to the content field.
  6. Open the other widgets and add the newly created URLs field.

Defining your data table

You will need to create your table in a tool such as phpMyAdmin or from the command line to add to your Aiki database. You may also import other tables to be used from other databases or web applications via the same method. Please note that a table must have one field to autogenerate its' own form. It is good practice to have at least one auto-generated form per table to reduce confusion.

I will not go into great detail in this document about how to actually setup a table, please refer to Aiki Forms and Tables.

Calling and formatting table records

Aiki can take a SQL statement and return you the information and can can automatically loop through multiple rows. Pagination will automatically be generated based on what is defined in the "Link Example Field" and the settings of the "records per page" and "records per row" fields. You simply embed aiki markup within html, and Aiki will do the rest.

((field_name))

You can view more information about how to work with Aiki Markup.

Whats next?

You can also create a portal for you, or users, to add, remove and update records. This is covered in Aiki Forms and Tables.

See Related Pages

Personal tools