Terrence Brannon | 11 Dec 01:32

table rows using alternating style info?

Hi, I glanced through the Petal docs and am very impressed - it puts
my HTML::Seamstress to shame.

I did not see an example of how to make alternating table rows using
different style information (usually the variation is background
color).

Could someone show how that is done in Petal.

Regards

Chris Croome | 11 Dec 18:45
Picon
Favicon

Re: table rows using alternating style info?

Hi

On Sat 11-Dec-2004 at 12:32:54AM +0000, Terrence Brannon wrote:
> 
> I did not see an example of how to make alternating table rows using
> different style information (usually the variation is background
> color).
> 
> Could someone show how that is done in Petal.

I set this up the other day for some tables in MKDoc 1.8 (we must
set up viewcvs or something...), this is a extract from the
audience_list template, it's basically a matter of repeating the
row, this has the advantage that when you view the file in a browser
or WYSIWYG editor you get to see two different rows, one thing that
I don't know how to avoid is the ugly div that has to be omitted:

  <table>
    <div
      petal:omit-tag=""
      petal:repeat="audience self/audiences"
    >
      <!--? The odd row comes before the even row ?-->
      <tr 
        class="odd"
        petal:condition="true: repeat/odd"
      >
        <td>
          <!-- stuff here -->
        </td>
(Continue reading)

Terrence Brannon | 12 Dec 04:01

Re: help for cpan modules etc..

Steve Purkis <steve.purkis@...> writes:

> On Oct 7, 2004, at 08:07, Andy Wardley wrote:
>
>> Steve Purkis wrote:
>>> Perhaps we'll finally see Petal & TT2 [3?] working together...

Help me out here. If I'm developing a website, Imight have XHTML
templates on disk and my view, controller amd model logic written in
Perl. As tt2 is a tool for view logic, it seems to be an alternative for
petal, not something that would work with it.

I'm sure that there are entire websites developed with MkDoc that did
not use/need tt2 at all... 

Steve Purkis | 13 Dec 11:29

Re: Re: help for cpan modules etc..

On Dec 12, 2004, at 03:01, Terrence Brannon wrote:

> Steve Purkis <steve.purkis@...> writes:
>
>> On Oct 7, 2004, at 08:07, Andy Wardley wrote:
>>
>>> Steve Purkis wrote:
>>>> Perhaps we'll finally see Petal & TT2 [3?] working together...
>
> Help me out here. If I'm developing a website, Imight have XHTML
> templates on disk and my view, controller amd model logic written in
> Perl. As tt2 is a tool for view logic, it seems to be an alternative 
> for
> petal, not something that would work with it.

At the moment, it is an alternative.  That's the problem, IMHO.

The thing is, they are both templating systems -- they both parse 
templates, create cached copies of them, and render them.  They even 
have a similar invocation syntax.

 From the user's POV, the only thing that differs is the syntax.  In an 
ideal world, Petal would just be a flavour of TT3, which from my 
understanding, is simply an engine for writing templating systems that 
have different syntax.  So the idea is: share the common foundation, 
and keep the different template languages.

The idea is this kind of engineering change would be transparent to 
users - they wouldn't realize or even care that they're using the TT3 
engine.  But they'd benefit from it's features (f.e: better template 
(Continue reading)

William McKee | 14 Dec 15:22
Favicon

Re: Petal question

On Mon, Dec 13, 2004 at 05:49:20PM -0500, Josh Narins wrote:
> I, too, got a couple Petal messages, then tried sending one and got the
> four hours delayed message.

That's odd. You should try sending a message to the mailing list
administrator and see if they have any ideas.

I've CC'ed the list with this message to see if it gets through.

William

--

-- 
Knowmad Services Inc.
http://www.knowmad.com

Bruno Postle | 14 Dec 15:42
X-Face

Re: Petal question

On Tue 14-Dec-2004 at 09:22 -0500, William McKee wrote:
> 
> I've CC'ed the list with this message to see if it gets through.

Fixed, Josh's mail was being refused because it was relayed from a
server with an invalid hostname.

Josh you need to give your computer a hostname other than "node1",
"node1.narins.net" will do fine.

--

-- 
Bruno

Josh Narins | 12 Dec 20:07

Dynamic includes...

Hello Petal People,

   I would like to do dynamic includes like this...

   $template->process({ extra_content => '/other.xml'})

   And have the file referred to by "extra_content" in the href
   attribute of this this template:

   <xi:include href="" /> 

   or this file attribute of this one...
   <?include file=""?>

   But I can't seem to get either to work.

Thanks in advance,
Josh Narins

Chris Croome | 15 Dec 15:16
Picon
Favicon

Re: Dynamic includes...

Hi

On Sun 12-Dec-2004 at 02:07:10PM -0500, Josh Narins wrote:
> 
>    I would like to do dynamic includes like this...
> 
>    $template->process({ extra_content => '/other.xml'})
> 
>    And have the file referred to by "extra_content" in the href
>    attribute of this this template:
> 
>    <xi:include href="" /> 
> 
>    or this file attribute of this one...
>    <?include file=""?>
> 
>    But I can't seem to get either to work.

I can't help with the Perl code you need, but FWIW both the include
syntaxes you have been trying are old hacks and the best way to do this
is using macros, these take a bit of getting used to but they are a lot
more powerful, they are documented here:

  http://search.cpan.org/~jhiver/Petal-2.14/lib/Petal.pm#METAL_MACROS

Chris  

--

-- 
Chris Croome                               <chris@...>
web design                             http://www.webarchitects.co.uk/ 
(Continue reading)

Bruno Postle | 15 Dec 15:33
X-Face

Re: table rows using alternating style info?

In addition to getting the odd or even status of the loop item..

    petal:condition="true: repeat/even"

..you can do this sort of thing:

    petal:condition="true: repeat/start"
    petal:condition="true: repeat/inner"
    petal:condition="true: repeat/end"

> This example should be added to Petal POD -- there isn't an example
> like this documented anywhere.

These methods are documented, but only when used with the old 
deprecated syntax:

    http://search.cpan.org/dist/Petal/lib/Petal/Deprecated.pm#loops

Until the documentation for normal Petal syntax is fixed, you need 
to refer to that.

--

-- 
Bruno

William McKee | 16 Dec 19:40
Favicon

Re: Dynamic includes...

On Wed, Dec 15, 2004 at 02:16:27PM +0000, Chris Croome wrote:
> I can't help with the Perl code you need, but FWIW both the include
> syntaxes you have been trying are old hacks and the best way to do this
> is using macros, these take a bit of getting used to but they are a lot
> more powerful, they are documented here:

Hey Chris,

So that's what METAL is about! Thanks for the info. I've been using the
old XInclude format since it was introduced as a replacement for the
original technique. Using METAL, it looks like I can keep all my
includes in a single file and reference the various sections as needed.
That's pretty useful.

Cheers,
William

--

-- 
Knowmad Services Inc.
http://www.knowmad.com


Gmane