|
|
Templates definitions reference
Small text
Medium text
Large text
Select options
Image
Text Link
Image link
Flash file
File
Repeater
Recursive
Small text
Prefix: ts
Atributes:
- :name=>[String] - [Prefix]_[Name] name must have underscores instead of spaces, in the admin interface spaces will be displayed.
Example {:name=>'ts_name'}
Medium text
Prefix: tm
Atributes:
- :name=>[String]
- [Prefix]_[Name] name must have underscores instead of spaces, in the
admin interface spaces will be displayed.
- :formatting=>[Boolean] - whether or not wyswig formatting
will be provided in the admin interface when user is editing the text.
Set to false if you don't want unecessary formatting being done. ie.
Text that will be displayed inside header tags.
Example
{:name=>'tm_Page_title', :formatting=>false}
Large text
Prefix: tl
Atributes:
- :name=>[String]
- [Prefix]_[Name] name must have underscores instead of spaces, in the
admin interface spaces will be displayed.
- :formatting=>[Boolean] - whether or not wyswig formatting
will be provided in the admin interface when user is editing the text.
Set to false if you don't want unecessary formatting being done. ie.
Text that will be displayed inside header tags.
Example
{:name=>'tl_How_to'}
Select options
Prefix: sel
Atributes:
- :name=>[String]
- [Prefix]_[Name] name must have underscores instead of spaces, in the
admin interface spaces will be displayed.
- :options=>[Array or Hash] - List of Array elements or can populate the options from the db by supplying a hash with 2 key/value pairs of :model=>[Model_class] and :result=>[an Active Record result set uses id as option value and name as option display text]
- :default=>[String or Numeric] - The option that will be selected by default
Examples:
Three text options in dropdown
{:name=>'sel_Status', :options=>['home', 'latest', 'archive']}
Use the the Country ActiveRecord class to populate the dropdown. {:name=>'sel_Country_id', :options=>{:model=>Country, :result=>Country.find(:all, :order=>'name')}}
Image
Prefix: img
Atributes: (all optional except :name)
- :name=>[String]
- [Prefix]_[Name] name must have underscores instead of spaces, in the
admin interface spaces will be displayed.
- :width=>[integer] - specifies pixels to resize image to when user uploads image in admin area.
- :height=>[integer] - as with width but for height of image.
- :thumb=>[boolean or Hash] - default is for no thumb so can set to true or hash with width or height values for the thumb, if no width or height is given thumb is resized to a height of 90px by default.
- :original=>[boolean] - defaults to false, if true geego will save a copy of the original image aswell. So it could be possible to have a thumb, main (for displaying on web page) and original for downloading, very usefull for an image repository.
- :caption=[boolean] - defaults to false, if true end user can edit a caption for the image.
- :alt=> [boolean] - defaults to false, if true end user can edit alt text for the image.
- :crop=> [string] - "[width]x[height]" eg. "900x300" The crop attribute would normally need to be used in conjunction with :width or :height in order to cater for various landscape and portrait images. For example if you set the image to a width of 900 then and then crop to "900x300" you will transform all landscape and portrait images nicely to a slender horizontal image (use full for header images)
- :square => [integer] - The square attribute resizes an image by either width or height depending on whether it is landscape or portrait and then crops it to make it square.
Example:
An image that is resized to a height 300 on upload with a thumb that is resized to a width of 150.
{:name=>'img_Image', :height=>300, :thumb=>{:width=>150}}
An image that is resized to a height 300 with a thumb resized to height of 90px, the original image saved and the ability to edit the alt text.
{:name=>'img_Photo', :height=>300, :thumb=>true, :original=>true, :alt=>true}
An image that is cropped to a width of 900 and a height of 300.
{:name=>'img_Background_image', :width=>900, :crop=>'900x300'}
Make a square image of 45 by 45 pixels.
{:name=>"img_Profile", :square=>45}
Text Link
Prefix: at
Atributes:
- :name=>[String]
- [Prefix]_[Name] name must have underscores instead of spaces, in the
admin interface spaces will be displayed.
Example
{:name=>'at_Weather_link'}
Image link
Prefix: ai
Atributes:
- :name=>[String]
- [Prefix]_[Name] name must have underscores instead of spaces, in the
admin interface spaces will be displayed.
- :width=>[integer] - specifies pixels to resize image to when user uploads image in admin area.
- :height=>[integer] - as with width but for height of image.
Example
{:name=>'ai_Partner_link'}
Flash file
Prefix: swf
Atributes:
- :name=>[String]
- [Prefix]_[Name] name must have underscores instead of spaces, in the
admin interface spaces will be displayed.
- :width=>[integer] - specifies width of flash file
- :height=>[integer] - height of flash file
Example
{:name=>'swf_Opening_animation'}
File
Prefix: file
Atributes:
- :name=>[String]
- [Prefix]_[Name] name must have underscores instead of spaces, in the
admin interface spaces will be displayed.
- :type=>[string] - file extension eg. mov. This tells the admin system how to display the content data item, it presently only displays mov (quicktime) movies as embeded movie. All other files will be displayed as a normal link.
Repeater
Prefix: r
Atributes:
- :name=>[String]
- [Prefix]_[Name] name must have underscores instead of spaces, in the
admin interface spaces will be displayed.
- :fields=>[array] - Array of content data definitions which make up fields of table/grid.
- :new_row=>[String] - By default new rows go to end of list. If you set this to 'top' a new row will go to top of list.
- :publish_model=> [String] Name of publish model that repeater will be published to. This is optional you will need to have a db table with relevant fields and corresponding ActiveRecord object that can hold the published data.
- :paginate => [boolean or integer] - Paginates the repeater to default (10 rows if true) or integer.
Recursive
Prefix: rc
Atributes:
:name=>[String]
- [Prefix]_[Name] name must have underscores instead of spaces, in the
admin interface spaces will be displayed.
Note: The recursive content data type can only be used inside the fields attribute of a repeater. It inherits the same fields as the repeater it is in.
Example:
{:name=>'r_Documentation_menu', :fields=>['at_Link', 'rc_Sub_menu']}
This creates an unlimited recursive menu.
|