Geego cms - content mangement system - website management

Display in views syntax

Overview

With a default installation you will create the display temlates in /app/veiws/g_pub. You can however put them anywhere you just need to alter routes.rb and the controller you want to use.

So by default the variable @g will be populated with all the content data for a particular page. This would typically consist of the pages content data items and any shared portions that the page uses.

So as a simple example we have a template definition file called /geego/text_and_image.rb with contains the following:

{:name=>'tm_Page_title', :formatting=>false},
{:name=>'img_Image'},
{:name=>'tl_Text'}


and a file to display this data called /app/views/c_pub/text_and_image.rhtml which contains the following:

<%= @g[:page_title] %>

<%= image_tag @g[:image][:show] %>

<%= @g[:text] %>


As you can see, you acess the content data from @g by the name with out the prefix, lower case and as a symbol.

The reference gives you the methods for accessing data from each content data type.