Re: [Zope] Calling a Variable

2007-03-09 Thread Tino Wildenhain

Martijn Pieters schrieb:

On 3/8/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
I thought I could call a variable in a page template by defining it 
and then

putting a ? in front of it in a URL, like this:


Incorrect, you can only use ? to interpolate variables into a path 
expression:


 span tal:define=foo string:bar
 tal:content=here/?foo/span

The above example will look up 'bar' and render it as the content of the 
span.



I notice ZPT gets weirder and weirder...
How many syntactic specialities will we add to path expressions? ;)
Why not keep it simple? :-)

Or make it simpler by removing even tal:define ...

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Calling a Variable

2007-03-09 Thread Martijn Pieters

On 3/9/07, Tino Wildenhain [EMAIL PROTECTED] wrote:

I notice ZPT gets weirder and weirder...
How many syntactic specialities will we add to path expressions? ;)


?var interpolation have been supported since the first checkin Evan
Simpson made nearly 6 years ago, the feature has been a bit
underdocumented, but it is not a recent addition..

--
Martijn Pieters
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Calling a Variable

2007-03-09 Thread Chris Withers

[EMAIL PROTECTED] wrote:

Hi;
I thought I could call a variable in a page template by defining it and then 
putting a ? in front of it in a URL, like this:
 
html tal:define=global base_url here/baseURL;

template_id string:index;
here python:here.restrictedTraverse('s/c/x/root/en-us/Help')


redefining 'here' isn't a good idea...


a href=?base_url/contactus.pt


I think you meant:

a href=#
   tal:attributes=href string:${base_url}/contactus.pt

cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Calling a Variable

2007-03-09 Thread Chris Withers

Tino Wildenhain wrote:

I notice ZPT gets weirder and weirder...


It's always been that weird ;-)

If you want sanity, try Twiddler instead :-)

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Calling a Variable

2007-03-08 Thread tonylabarbara
Hi;
I thought I could call a variable in a page template by defining it and then 
putting a ? in front of it in a URL, like this:
 
html tal:define=global base_url here/baseURL;
template_id string:index;
here python:here.restrictedTraverse('s/c/x/root/en-us/Help')
 
a href=?base_url/contactus.pt
 
Please tell me what I'm doing wrong.
TIA,
Tony

AOL now offers free email to everyone.  Find out more about what's free from 
AOL at AOL.com.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Calling a Variable

2007-03-08 Thread Andreas Jung



--On 8. März 2007 12:48:26 -0500 [EMAIL PROTECTED] wrote:


Hi;
I thought I could call a variable in a page template by defining it and
then putting a ? in front of it in a URL, like this:


How told you that? Please refer to the ZPT documentation in the Zope Book.

-aj

pgp85HTzxZq8q.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Calling a Variable

2007-03-08 Thread Martijn Pieters

On 3/8/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

I thought I could call a variable in a page template by defining it and then
putting a ? in front of it in a URL, like this:


Incorrect, you can only use ? to interpolate variables into a path expression:

 span tal:define=foo string:bar
 tal:content=here/?foo/span

The above example will look up 'bar' and render it as the content of the span.

--
Martijn Pieters
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Calling a Variable

2007-03-08 Thread eXt
Dnia czwartek, 8 marca 2007 18:48, [EMAIL PROTECTED] napisał:
 Hi;
 I thought I could call a variable in a page template by defining it and then 
putting a ? in front of it in a URL, like this:
You messed some things. First go to google.com and look into address bar in 
your browser. Then enter any value into search box (plz don't ask me what 
is any value ;) ) and click search. Look into the address bar again. You 
will see there something like: 
google.com?variable_name=variable_valueanother_variable_name=another_variable_value
 
etc. google.com is in your case base_url, and things after ? and  are 
variables that are passed to server (in your case Zope) from your browser 
(via request).

 html tal:define=global base_url here/baseURL;
 template_id string:index;
 here python:here.restrictedTraverse('s/c/x/root/en-us/Help')
Do you really want to define a variable named here?

 a href=?base_url/contactus.pt
What you want here is: base_url/contactus.pt?variable=variable_value. To put a 
variable value into href attribute use tal:attributes=href ...

 Please tell me what I'm doing wrong.
I tried to be a bit more specific that guys in other answers but please do 
what they suggested to you: read zope book :)

 Tony

-- 
Jakub Wisniowski
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Calling a Variable

2007-03-08 Thread tonylabarbara
Thanks for clarifying that!
Tony 
 
-Original Message-
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: zope@zope.org
Sent: Thu, 8 Mar 2007 2:14 PM
Subject: Re: [Zope] Calling a Variable


On 3/8/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: 
 I thought I could call a variable in a page template by defining it and then 
 putting a ? in front of it in a URL, like this: 
 
Incorrect, you can only use ? to interpolate variables into a path expression: 
 
 span tal:define=foo string:bar 
  tal:content=here/?foo/span 
 
The above example will look up 'bar' and render it as the content of the span. 
 
-- Martijn Pieters 

AOL now offers free email to everyone.  Find out more about what's free from 
AOL at AOL.com.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )