Re: [PHPTAL] Any updates to translation tools?

2011-08-22 Thread Christoph Frick
On Fri, Aug 19, 2011 at 11:37:16PM -0700, Darrell Hamilton wrote:

 As for HTML to Markdown, Pandoc, http://johnmacfarlane.net/pandoc/ , seems
 to be the de facto standard so I'm going to start off with that one.

i have recently switched a restructured text doku wiki over to Sphinx
[1].  there is also a converter from DB to RST suggested by them [2] --
but i don't know nothing about the quality.

[1] http://sphinx.pocoo.org/index.html

[2] http://code.google.com/p/db2rst/

-- 
cu


pgpQtMZcfK7O9.pgp
Description: PGP signature
___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] Need confirmation about the pipe syntax inside tal:attributes

2009-08-07 Thread Christoph Frick
On Fri, Aug 07, 2009 at 03:32:43PM +0200, Guillaume Lecanu wrote:

 input name=firstname value= tal:attributes=value firstname| /

i usually use 

input name=firstname value= tal:attributes=value firstname|default /

this uses the value from the value-attribute. the suggested nothing of
course is fine too.

-- 
cu


pgpSJoJ7LwKXj.pgp
Description: PGP signature
___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] Chains of strings in PHPTAL

2008-12-22 Thread Christoph Frick
On Mon, Dec 22, 2008 at 06:14:23PM +0100, Szymek Przyby? wrote:
 I want to add names for inputs like this:

 input type=text name=team[x]/

 Where x is number of team. Something like this:

 input type=text tal:attributes=name php:'team['.team['id'].']' /

 Doesn't works, but this:

 input type=text tal:attributes=name php:'team['.user['id']/
 (without ending ] )
 Works. How can I add this names with ] ending?

input type=text name=team[${team/id}]/

- or -

input type=text tal:attributes=name string:team[${team/id}]/

should do. 

avoid the use of php: - it usually tends to get ugly. you could even
create the names in your app or write an accessor for it. would even
make sense, once your app will read them again.

-- 
cu


pgpZkdIBeJM0i.pgp
Description: PGP signature
___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] omit-tag or ${}?

2008-11-19 Thread Christoph Frick
On Wed, Nov 19, 2008 at 11:11:37AM +0100, Szymek wrote:

 Which method of inserting a single variable into same element is better:

 spanx tal:omit-tag= tal:content=price ???/span

 or

 span${price} ???/span
 ?
 Evidently second method is much shorter, but which is more productivity 
 (which is easier for PHPTAL to parse)?

or

span tal:replace=price/price//span

or

span tal:content=price/price//span

-- 
cu


pgpCf6Y8xG2Ya.pgp
Description: PGP signature
___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] omit-tag or ${}?

2008-11-19 Thread Christoph Frick
On Wed, Nov 19, 2008 at 11:58:02AM +0100, Szymek Przyby? wrote:

 How works this expression: 'price | defaultPrice | nothing' (I don't
 saw something like this in manual)?

it evaluates like a logical or in php. is there price? use it - if not
is there defaultPrice? use it - if not use nothing. be sure to also
check ``something | default`` and the ``exists:`` stuff in the doku.

 And how difference is between replace and content expression?

see Kornels other mail

-- 
cu


pgpTF8U6Vc1bR.pgp
Description: PGP signature
___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] String in HTML Comment/Class definition

2008-09-05 Thread Christoph Frick
On Fri, Sep 05, 2008 at 12:28:39PM +0200, Mathias Jacob wrote:

 !-- start tal:block tal:content=structure color / box --
 div class=panel-tal:block tal:content=structure color //div
 !-- end tal:block tal:content=structure color / box --

div class=somedefault tal:attributes=class class|default.../div

then call it with 

metal:macro tal:define=class string:someotherclass 
metal:use-macro=somemacro /

-- 
cu


pgpI9GiUEZXNo.pgp
Description: PGP signature
___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] Gettext tools for TAL

2008-09-04 Thread Christoph Frick
On Thu, Sep 04, 2008 at 04:16:29PM +0300, Tero Heikkinen wrote:

 I was just studying about the possibilities to collect i18n entries
 from TAL.

 Is there some possible tool, like xgettext is for PHP, that you can
 use to collect strings that need translation from the TAL templates?

i am very happy with i18nfool (their xml parser is better than the one
in phptal and you might end up fixing xml first). never tried i18ndude.

-- 
cu


pgp052opn0V4p.pgp
Description: PGP signature
___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] Error in the manual or bug in phptal?

2008-08-21 Thread Christoph Frick
On Thu, Aug 21, 2008 at 11:37:52AM +0200, tarjei wrote:

 When I try the following example:
 option value=main-twocolumn.html
 tal:attributes=SELECTED php: menuItem.template == 'main-twocolumn.html'
 ? 'SELECTED': false
 Tospalter/option

By default ``selected`` and ``checked`` are handled special in TAL. Can
you try::

 tal:attributes=selected php:menuItem.template=='main-twocolumn.html'

-- 
cu


pgpNoDRmswXoz.pgp
Description: PGP signature
___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] concatenate string

2008-08-04 Thread Christoph Frick
On Mon, Aug 04, 2008 at 11:11:10AM +1200, anru chen wrote:

 person-id = 1;
 person-name=;
 person-email = [EMAIL PROTECTED].
 
 my question is how can i do some thing like this:
 
 button name=sub value= button
 I want to set the button value equal to person/id . _. person/name (1_)

button name=sub value=SomeName tal:attributes=value 
string:${person/id}_${person/name} /

on the other hand - if the value there is app releavant then you might
generate it in php.

-- 
cu


pgp4EsSYMoOOi.pgp
Description: PGP signature
___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] Multiple conditions

2008-05-30 Thread Christoph Frick
On Fri, May 30, 2008 at 07:04:47PM +0300, Anton Andrievskij wrote:

 How can I specify multiple conditions using AND logical operator and php:
 for one of the parts?
 
 I'm trying this but does not works:
 
 tal:condition=exists: products AND php:count(products) == 0

in python an empty list is also false. iirc phptal works in the same
way. so maybe you are better of by setting products all the time - even
if the list is empty - and then just tal:condition=products?

-- 
cu


pgpyAQYtfKCxW.pgp
Description: PGP signature
___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] How to uses correctly PHPTAL to limit the copy/paste of XHTML ?

2008-04-23 Thread Christoph Frick
On Wed, Apr 23, 2008 at 05:07:47PM +0200, Guillaume Lecanu wrote:


 Like index.php and about.php have the same menu, I have added a
 /templates/macros.html page.  In this macros.html, I have added the
 menu div with the attribute metal:define-macro=menu.  In the 2
 others templates pages, I have set the menu sample to uses the
 macros.html version, for that I have used
 metal:use-macro=macros.html/menu 

You should read up the parts about define-slot and fill-slot in the
phptal docs.

-- 
cu


pgpZURCmt1DNK.pgp
Description: PGP signature
___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] JavaScript arrays using PHPTAL

2008-01-21 Thread Christoph Frick
On Mon, Jan 21, 2008 at 12:43:21PM +0200, Anton Andrievskij wrote:

 I have to fill JavaScript array using PHPTAL attributes.
 
 Whether I can use some span ...tal-attributes here../span inside
 script/script construction?
 
 Example:
 
 script language=JavaScript
items = array(
span ..PHPTAL loop here...
span tal:replace ...writing item values to fill JavaScript
 array.../span
/span
)
 /script
 
 
 If I can't do so, have you any idea about how to do it?

you can do so. but IE can not cope with trailing ``,``; so you have to
add something like:

 span tal:condition=not:repeat/item/end, /span

and beside that: why not write method, that returns the data directly?
or a phptal_tales_something formatter?

-- 
cu


pgpFbuPWUJM7f.pgp
Description: PGP signature
___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal