FAQ
(sorry I sent to wrong list first time my bad :( )

Hi,

I'm new to catalyst and am stuck on how to do this..

I'm using View::TT and for most of my requests I do
want it to use the standard config with:

PRE_PROCESS => 'config/main',
WRAPPER => 'site/wrapper',

However by the same token I have a number of other
requests, like ajax content coming into a div, where I
don't want to use those config options or add a
header/footer etc.

For now I've been getting around by using [% IF
somevar %] type blocks to include/exclude header/foot
content but that's rather hacked, what I really need
is to be able to configure the View::TT per request.

I even have one template that I need to display
without going through TT at all, it needs to show as
plain text so a user can edit it as is. For that I
had to edit the wrapper to pass it through as text
when it sees a template with that name.

So again if I could configure View:TT per request I
can avoid hacks.

thanks!
Devo

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Search Discussions

  • Bill Moseley at Oct 22, 2007 at 10:53 pm

    On Sun, Oct 21, 2007 at 07:29:12PM -0700, Devo Coran wrote:
    I'm using View::TT and for most of my requests I do
    want it to use the standard config with:

    PRE_PROCESS => 'config/main',
    WRAPPER => 'site/wrapper',

    However by the same token I have a number of other
    requests, like ajax content coming into a div, where I
    don't want to use those config options or add a
    header/footer etc.

    For now I've been getting around by using [% IF
    somevar %] type blocks to include/exclude header/foot
    content but that's rather hacked, what I really need
    is to be able to configure the View::TT per request.
    For most ajax responses I would use a separate view. But,
    for html content I want returned w/o headers and footers but still
    rendered with the same templates I use logic in my WRAPPER template
    to decide to return just [% content %]. So, similar to what you are
    describing.

    My WRAPPER template simply looks at the request headers to decide if
    its an ajax request. The only time I use this is when I want to return
    a page complete page segment via ajax. I do with with some tabbed
    pages, for example.

    --
    Bill Moseley
    moseley@hank.org
  • Matt S Trout at Oct 23, 2007 at 8:50 pm

    On Sun, Oct 21, 2007 at 07:29:12PM -0700, Devo Coran wrote:
    (sorry I sent to wrong list first time my bad :( )

    Hi,

    I'm new to catalyst and am stuck on how to do this..

    I'm using View::TT and for most of my requests I do
    want it to use the standard config with:

    PRE_PROCESS => 'config/main',
    WRAPPER => 'site/wrapper',

    However by the same token I have a number of other
    requests, like ajax content coming into a div, where I
    don't want to use those config options or add a
    header/footer etc.

    For now I've been getting around by using [% IF
    somevar %] type blocks to include/exclude header/foot
    content but that's rather hacked, what I really need
    is to be able to configure the View::TT per request.

    I even have one template that I need to display
    without going through TT at all, it needs to show as
    plain text so a user can edit it as is. For that I
    had to edit the wrapper to pass it through as text
    when it sees a template with that name.

    So again if I could configure View:TT per request I
    can avoid hacks.
    Why can't you just use

    $c->stash(additional_template_paths => [ ... ])

    to add extra search paths that result in a different wrapper/whatever template
    being picked up?

    --
    Matt S Trout Need help with your Catalyst or DBIx::Class project?
    Technical Director http://www.shadowcat.co.uk/catalyst/
    Shadowcat Systems Ltd. Want a managed development or deployment platform?
    http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedOct 22, '07 at 3:29a
activeOct 23, '07 at 8:50p
posts3
users3
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2021 Grokbase