Catalyst-Helper-View-TT-Bootstrap-YUI

 view release on metacpan or  search on metacpan

lib/Catalyst/Helper/View/TT/Bootstrap/YUI/Manual.pm  view on Meta::CPAN

=item page.head.scripts

 [%
    page.head.scripts.push(
        'widgets.js', 'widgets.js', page_name _ '.js',
        'http://somedomain.com/hosted/script.js');
 %]

Holds an array of javascript file names/URIs.  Works in the same fashion as
page.head.stylesheets.

Note that it is generally preferable from a performance standpoint to place
script tags at the bottom of the body tag.  For this reason, it is advisable to
use page.body.scripts rather than this.

=item page.body.id

Apply an ID to the body tag

=item page.body.classes

    [% page.body.classes.push('foo','foo','bar'); %]

Holds an array of class names to add to the body tag.  Duplicates are ignored.

Note that html.tt automatically adds classes 'IE' and 'IE(5|6|7)' to the body
tag using conditional comments.  These will only be added  when the requesting
browser is Internet Explorer.  This is useful for adding style rules to target
IE without resorting to css hacks.

Because of the nature of this package being reliant upon YUI out of the box,
ithe default value for C<page.body.classes> includes "yui-skin-sam".

=item page.body.scripts

Works exactly as page.head.scripts, except it adds script tags to the very end
of the body content.

The default value is to include YUI 3.0.0.

=item page.content_class

    [% page.content_class = 'wide_content' %]

Used by html.tt, assigned to the class of the div containing the page content.
Also used by layouts as a default container class.  See the info on the layouts
below.  Default value is 'content'.

=back

=head2 html.tt points of interest

html.tt creates the html, head and body elements of each page.  As noted above,
it references many of the page.* variables to populate these sections.

=over 4

=item HTML 4.01 strict DOCTYPE

Per the recommendation of the w3c, the broadcasted DOCTYPE is HTML 4.01 strict.
It was either this or XHTML 1.0 strict, but since you're likely delivering your
pages with Content-Type header set to 'text/html', this is more correct.  There
are arguments for and against using HTML 4.01 instead of XHTML 1.0, but it's
probably not worth the reading, since you really just want to get stuff done.

That said, please use HTML style closed tags or change the DOCTYPE in html.tt

    <p>This is<br>GOOD</p>
    <p>This is<br/>a waste of a character</p>

=item debug_init

    [% # in some PRE_PROCESS template
    MACRO devel_env BLOCK;
        ...etc...
    END;

    debug_init = 'devel_env';
    %]
    
If your server is running in debug mode, before anything, it checks if a
variable named debug_init is populated.  If it is, it attempts to execute a
macro by the name assigned to the variable.  This allows you to set up logging,
add scripts or stylesheets etc for use in development.

=item IE detection

html.tt uses IE conditional comments to decorate the body tag with a class 'IE'
and another class 'IE5', 'IE6', or 'IE7' depending on the version of the browser
requesting the page.  Non-IE browsers will no have these classes added.

This allows you to use the cascade in your css to target IE to correct display
issues that may*cough*WILL*cough* arise.

    /* Container dimensions */
    .container {
        width: 276px;
        padding: 10px:
        border: 2px solid #eee;
    }

    /* correction for IE's box model */
    .IE .container {
        width: 300px;
    }

=item Header, content, and footer separation

The header, content, and footer are rendered separately under the body element,
not wrapped in a global wrapping div.  This was done to allow layouts to use
the full content width for header/footer if their design mandates, but keep a
narrower content area centered.  If your design mandates consistent width, it's
probably easiest to move the open and close div tags surrounding [% content %]
to encompass the header and footer includes.

=back

=head1 STEALING AUTHOR

J. Shirley E<lt>jshirley@cpan.org<gt>

=head1 ORIGINAL AUTHOR



( run in 0.930 second using v1.01-cache-2.11-cpan-39bf76dae61 )