Reaction::UI::Widget::SiteLayout - The layout of the site as a whole


Reaction documentation Contained in the Reaction distribution.

Index


Code Index:

NAME

Top

Reaction::UI::Widget::SiteLayout - The layout of the site as a whole

DESCRIPTION

Top

This is a subclass of Reaction::UI::Widget::Container. It is generally used as the widget surrounding the site's content.

FRAGMENTS

Top

widget

Additionally provides these arguments after the parent widget fragment has been rendered:

static_base

The static_base_uri of the viewport.

title

The title attribute value of the viewport.

meta_info

If the viewports meta_info contains a value for http_header, It will be removed and set as http_header argument. Next, the meta_http_header fragment will be rendered for each key of the http_header hash reference.

After the http_header processing, the remaining keys of the viewports meta_info attribute hash reference will be rendered via the meta_member fragment.

meta_http_header

Additionally provides these arguments:

meta_name

The current value of the _ argument, which will be set to the key of the http_header argument hash reference when rendered by the meta_info fragment.

meta_value

The value of the meta_name key in the http_header argument hash reference.

meta_member

Additionally provides these arguments:

meta_name

The current value of the _ argument, which will be set to the key of the viewport's meta_info attribte value when rendered by the meta_info fragment.

meta_value

The value of the meta_name key in the viewport's meta_info attribute hash reference.

LAYOUT SETS

Top

base

  share/skin/base/layout/site_layout.tt

The base layout set will provide the following layouts:

widget

This layout will render the doctype fragment at the top of the page. Then the traditional HTML layout with a html element containing head (rendering the head fragment and body (rendering the body fragment) elements.

Will render the title argument in a title element. After that it will render the head_meta, head_scripts and head_style fragments.

head_meta

Renders the meta_info fragment.

meta_http_header

Renders a meta element where the value of the http-equiv attribute is set to the meta_name argument and the content attribute is set to the meta_value argument.

meta_member

Renders a meta element where the name attribute is set to the meta_name argument and the content attribute is set to the meta_value argument.

head_scripts

Is empty by default.

head_style

Is empty by default.

doctype

By default this renders an XHTML 1.0 Transitional doctype.

body

This will render the inner viewports in the focus stack.

default

  share/skin/default/layout/site_layout.tt

The site_layout layout set in the default skin extends the one in the base skin documented above.

The following layouts are provided:

widget

This layout is mostly the same as the one in the base skin, except that the html element has xmlns and xml:lang attributes set.

AUTHORS

Top

See Reaction::Class for authors.

LICENSE

Top

See Reaction::Class for the license.


Reaction documentation Contained in the Reaction distribution.

package Reaction::UI::Widget::SiteLayout;

use Reaction::UI::WidgetClass;
use aliased 'Reaction::UI::Widget::Container';
use MooseX::Types::Moose 'HashRef';

use namespace::clean -except => [ qw(meta) ];
extends Container;

after fragment widget {
  arg static_base => $_{viewport}->static_base_uri;
  arg title => $_{viewport}->title;
};

implements fragment meta_info {
  my $self = shift;
  if ( $_{viewport}->meta_info->{'http_header'} ) {
    my $http_header = delete $_{viewport}->meta_info->{'http_header'};
    arg 'http_header' => $http_header;
    render 'meta_http_header' => over [keys %$http_header];
  }
  render 'meta_member' => over [keys %{$_{viewport}->meta_info}];
};

implements fragment meta_http_header {
  arg 'meta_name' => $_;
  arg 'meta_value' => $_{'http_header'}->{$_};
};

implements fragment meta_member {
  arg 'meta_name' => $_;
  arg 'meta_value' => $_{viewport}->meta_info->{$_};
};

__PACKAGE__->meta->make_immutable;

1;

__END__