|
|
Template definitions
Template definitions are ruby files stored in /geego
eg. /geego/home.rb
Creating a template definition file
Create a new file in /geego
The definitions are a comma seperated list of Hashes. Each Hash describes a content data item and contains at least the :name key value pair and maybe other key values that tell Geego what to do.
A :name key value is made of 2 parts 1. The content data item type. 2. The name of the content data
For example: ts_Title is a small text data item with a name of tile. img_Photo_1 is an image with a name of photo_1.
The following is a list of all content data types: ts : Smail text tm : Medium text tl : Large text img :Image at : Link using text for display ai : Link using image for display swf :Flash file sel : Options list dt : Date file : Any file r : Repeating grid item rc : Recursive repeating grid item.
Essentially the above content data types allow you to make available various data entry/upload screens in the admin area with minimal coding. You are then free to display the published data as you see fit in the public pages also with minimal coding.
Best to show some examples.
Example 1. Simple page with text and one image.
Create the file /geego/text_and_image.rb
Edit the file entering the following code.
{:name=>'tm_Title', :formatting=>false}, {:name=>'img_Image'}, {:name=>'tl_Text'}
Save template, then in the admin area click on templates you should see file you created in the list ready to be added to templates list. Click add and give it a template type of page.
Now click on pages > new page and create a new page using the new template.
In the page list view select the new page and click on "content", you should now see a list of content items that you defined, click on edit next to each content item to enter/upload data.
Example 2. A news page
This example is more advanced don't worry if it seems complicated there is a full reference here.
The following provides a template with a page title and then a repeating data item with the following fields: status (dropdown with options of 'home', 'latest', 'archive') date title (with formatting/wyswig turned off as I will put this inside tags so don't want formatting) text photo (automaticaly set photo to a width of 300, resized on upload, and create a thumb with height of 95)
{:name=>'tm_Title', :formatting=>false}, {:name=>'r_News_items', :fields=>[{:name=>'sel_Status', :options=>['home', 'latest', 'archive'], :default=>'latest'}, 'dt_Date', {:name=>'tm_Title'}, 'tl_Text_1', {:name=>'img_Photo', :width=>300, :thumb=>{:height=>95}}] }
|