1 package Reaction::UI::Widget::SiteLayout;
3 use Reaction::UI::WidgetClass;
4 use aliased 'Reaction::UI::Widget::Container';
5 use MooseX::Types::Moose 'HashRef';
7 use namespace::clean -except => [ qw(meta) ];
10 after fragment widget {
11 arg static_base => $_{viewport}->static_base_uri;
12 arg title => $_{viewport}->title;
15 implements fragment meta_info {
17 if ( $_{viewport}->meta_info->{'http_header'} ) {
18 my $http_header = delete $_{viewport}->meta_info->{'http_header'};
19 arg 'http_header' => $http_header;
20 render 'meta_http_header' => over [keys %$http_header];
22 render 'meta_member' => over [keys %{$_{viewport}->meta_info}];
25 implements fragment meta_http_header {
26 arg 'meta_name' => $_;
27 arg 'meta_value' => $_{'http_header'}->{$_};
30 implements fragment meta_member {
31 arg 'meta_name' => $_;
32 arg 'meta_value' => $_{viewport}->meta_info->{$_};
35 __PACKAGE__->meta->make_immutable;
43 Reaction::UI::Widget::SiteLayout - The layout of the site as a whole
47 This is a subclass of L<Reaction::UI::Widget::Container>. It is generally
48 used as the widget surrounding the site's content.
54 Additionally provides these arguments after the parent widget fragment
61 The C<static_base_uri> of the viewport.
65 The C<title> attribute value of the viewport.
71 If the viewports C<meta_info> contains a value for C<http_header>, It will
72 be removed and set as C<http_header> argument. Next, the C<meta_http_header>
73 fragment will be rendered for each key of the C<http_header> hash reference.
75 After the C<http_header> processing, the remaining keys of the viewports
76 C<meta_info> attribute hash reference will be rendered via the C<meta_member>
79 =head2 meta_http_header
81 Additionally provides these arguments:
87 The current value of the C<_> argument, which will be set to the key of
88 the C<http_header> argument hash reference when rendered by the
89 C<meta_info> fragment.
93 The value of the C<meta_name> key in the C<http_header> argument hash
100 Additionally provides these arguments:
106 The current value of the C<_> argument, which will be set to the key of
107 the viewport's C<meta_info> attribte value when rendered by the
108 C<meta_info> fragment.
112 The value of the C<meta_name> key in the viewport's C<meta_info> attribute
121 share/skin/base/layout/site_layout.tt
123 The base layout set will provide the following layouts:
129 This layout will render the C<doctype> fragment at the top of the page. Then
130 the traditional HTML layout with a C<html> element containing C<head> (rendering
131 the C<head> fragment and C<body> (rendering the C<body> fragment) elements.
135 Will render the C<title> argument in a C<title> element. After that it will render
136 the C<head_meta>, C<head_scripts> and C<head_style> fragments.
140 Renders the C<meta_info> fragment.
142 =item meta_http_header
144 Renders a C<meta> element where the value of the C<http-equiv> attribute is set to
145 the C<meta_name> argument and the C<content> attribute is set to the C<meta_value>
150 Renders a C<meta> element where the C<name> attribute is set to the C<meta_name>
151 argument and the C<content> attribute is set to the C<meta_value> argument.
163 By default this renders an C<XHTML 1.0 Transitional> doctype.
167 This will render the C<inner> viewports in the focus stack.
173 share/skin/default/layout/site_layout.tt
175 The C<site_layout> layout set in the C<default> skin extends the one in the
176 C<base> skin documented above.
178 The following layouts are provided:
184 This layout is mostly the same as the one in the C<base> skin, except that
185 the C<html> element has C<xmlns> and C<xml:lang> attributes set.
191 See L<Reaction::Class> for authors.
195 See L<Reaction::Class> for the license.