Sha256: 6418f4d930859483dd1210ec1863877cde7e5cfc057bbf9dd7c9da895882c232

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

# ActsAsLayoutable

## Usage

### Install

    sudo gem install acts-as-layoutable

### Usage

    Layoutable do
      # defines valid areas
      areas :top, :bottom, :left, :right, :header, :footer, :center
      
      grids do
        full :top, :bottom, :left, :right, :center
        left :top, :bottom, :right
        portfolio :top, :bottom, :center
        blog do
          right :text, :social
        end
      end
      
      widgets do
        text do
          title :string, :label => "Sample text"
          body :text
        end
        
        social do
          links :as => Link
        end
      end
    end

That creates cells, areas, and layouts.

### Api

    Layoutable.widgets #=> [text, social]
    Layoutable.areas #=> [:top, :bottom, :left, :right, :header, :footer, :center]
    Layoutable.layouts #=> [:full, :left, :portfolio]
    layout = Layout.first
    layout.widgets
    layout.top_widgets
    layout.bottom_widgets
    
- Each `Post` has a different `Layout` via `clone`.
- New layouts cannot be constructed outside of this dsl.  Only the order and presence of cells within areas can be customized.
- `area` is the "context" for the join of Layout to Widget.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
acts-as-layoutable-0.0.1.7 README.markdown