Re: [Zope] extract page title

2007-04-25 Thread Dean Hale


Hello all,

Thanks very much for all of your help.

thanks
dean

On 24 Apr 2007, at 16:20, Andreas Jung wrote:



--On 24. April 2007 09:56:41 -0500 Jeff Rush [EMAIL PROTECTED] wrote:



I don't see above him putting a title tag within the script  
tag.  He
wants to put the *value* of the title tag inside the script  
tag.  It
seems some form of a string: expression would do it, assuming the  
title

is not literally in the zpt but rather expanded from a variable.

script language='JavaScript1.1' type='text/javascript'
 noscript
img tal:attributes=src
http://domain/xxx/xxx/s?websitename.${title_or_id};  width=1
height=1 alt= /
/noscript
/script



As far as I can recall: you can't use TALES within a SCRIPT block.
That's why you must generate your stuff outside inside a script.

-aj


___
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] extract page title

2007-04-25 Thread SpiderX

It escapes the characters inside the SCRIPT block before processing, why is
why you can't do any TALES or anything else really in there...

On 4/24/07, Andreas Jung [EMAIL PROTECTED] wrote:




--On 25. April 2007 00:41:19 -0500 Jeff Rush [EMAIL PROTECTED] wrote:

 Andreas Jung wrote:

 As far as I can recall: you can't use TALES within a SCRIPT block.
 That's why you must generate your stuff outside inside a script.

 Ah thanks I wasn't aware of that exclusion, never having tried it or
 found it documented.  Then yes your approach is the only one left.


The reason is obvious: Usually you don't have any markup with
script../script. Still not getting why generate img within a
script
tag...appears like broken-by-design to me...but I don't care.

-aj
___
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 )






--
Thanks,
Derek Wilson
___
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] extract page title

2007-04-24 Thread Andreas Jung



--On 24. April 2007 15:05:49 +0100 Dean Hale [EMAIL PROTECTED] 
wrote:



Hi

I'm trying to implement some web tracking code within a page template,
however a little stuck.

In the code below i'd like to append the page template - page title
between the title tags dynamically rather than having to manually add
to each page

script language='JavaScript1.1' type='text/javascript'
noscript
img src=http://domain/xxx/xxx/s?websitename.PAGETITLE;
width=1 height=1 alt=
/noscript
/script



Please rephrase your posting. It's not easy to understand what your real
problem is (using TALES within the script tag?).

-aj

pgpHFZ9Pzp44q.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] extract page title

2007-04-24 Thread Dean Hale


Hi Andreas,

Thanks, will try

basically if i have some zpt pages with the tiltle

titleINTRODUCTION/title

titleABOUT/title

somehow within below the page title should be appended after  
'websitename.'



script language='JavaScript1.1' type='text/javascript'
noscript
img src=http://domain/xxx/xxx/s?websitename.INTRODUCTION;
width=1 height=1 alt=
/noscript
/script



script language='JavaScript1.1' type='text/javascript'
noscript
img src=http://domain/xxx/xxx/s?websitename.ABOUT;
width=1 height=1 alt=
/noscript
/script


does this make more sense? thanks again.

dean

On 24 Apr 2007, at 15:16, Andreas Jung wrote:



--On 24. April 2007 15:05:49 +0100 Dean Hale  
[EMAIL PROTECTED] wrote:



Hi

I'm trying to implement some web tracking code within a page template,
however a little stuck.

In the code below i'd like to append the page template - page title
between the title tags dynamically rather than having to manually  
add

to each page

script language='JavaScript1.1' type='text/javascript'
noscript
img src=http://domain/xxx/xxx/s?websitename.PAGETITLE;
width=1 height=1 alt=
/noscript
/script



Please rephrase your posting. It's not easy to understand what your real
problem is (using TALES within the script tag?).

-aj



___
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] extract page title

2007-04-24 Thread Andreas Jung



--On 24. April 2007 15:25:24 +0100 Dean Hale [EMAIL PROTECTED] 
wrote:




Hi Andreas,

Thanks, will try

basically if i have some zpt pages with the tiltle

titleINTRODUCTION/title

titleABOUT/title

somehow within below the page title should be appended after
'websitename.'


script language='JavaScript1.1' type='text/javascript'
noscript
img src=http://domain/xxx/xxx/s?websitename.INTRODUCTION;
width=1 height=1 alt=
/noscript
/script



script language='JavaScript1.1' type='text/javascript'
noscript
img src=http://domain/xxx/xxx/s?websitename.ABOUT;
width=1 height=1 alt=
/noscript
/script


does this make more sense? thanks again.


no.

a TITLE tag does not belong inside script tag.

-aj




pgpy2epT1oPpt.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] extract page title

2007-04-24 Thread Dean Hale


Hi Andreas,

Thanks - i know the title does not belong in a script tag, i just  
want the text within the title tag appended within the javascript,  
not the tags themselves. Sorry its my explanations for help that are  
unclear.


thanks
dan

On 24 Apr 2007, at 15:35, Andreas Jung wrote:



--On 24. April 2007 15:25:24 +0100 Dean Hale  
[EMAIL PROTECTED] wrote:




Hi Andreas,

Thanks, will try

basically if i have some zpt pages with the tiltle

titleINTRODUCTION/title

titleABOUT/title

somehow within below the page title should be appended after
'websitename.'


script language='JavaScript1.1' type='text/javascript'
noscript
img src=http://domain/xxx/xxx/s?websitename.INTRODUCTION;
width=1 height=1 alt=
/noscript
/script



script language='JavaScript1.1' type='text/javascript'
noscript
img src=http://domain/xxx/xxx/s?websitename.ABOUT;
width=1 height=1 alt=
/noscript
/script


does this make more sense? thanks again.


no.

a TITLE tag does not belong inside script tag.

-aj






___
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] extract page title

2007-04-24 Thread Jeff Rush
Andreas Jung wrote:
 
 --On 24. April 2007 15:25:24 +0100 Dean Hale
 [EMAIL PROTECTED] wrote:
 
 basically if i have some zpt pages with the title

 titleINTRODUCTION/title

 titleABOUT/title

 somehow within below the page title should be appended after
 'websitename.'

 script language='JavaScript1.1' type='text/javascript'
 noscript
 img src=http://domain/xxx/xxx/s?websitename.INTRODUCTION;
 width=1 height=1 alt=
 /noscript
 /script

 script language='JavaScript1.1' type='text/javascript'
 noscript
 img src=http://domain/xxx/xxx/s?websitename.ABOUT;
 width=1 height=1 alt=
 /noscript
 /script

 does this make more sense? thanks again.
 
 no.
 
 a TITLE tag does not belong inside script tag.

I don't see above him putting a title tag within the script tag.  He wants
to put the *value* of the title tag inside the script tag.  It seems some
form of a string: expression would do it, assuming the title is not literally
in the zpt but rather expanded from a variable.

script language='JavaScript1.1' type='text/javascript'
 noscript
img tal:attributes=src http://domain/xxx/xxx/s?websitename.${title_or_id};
 width=1 height=1 alt= /
/noscript
/script

Apparently he has named his image files according to the title of the page on
which they appear.  Hopefully the names are not in need of URL-quoting, as I'm
not sure how you do that within a string: expression.

If the value of the title is *literally* in the zpt file above his img
tag, then I know of no way for a zpt expression to extract literal text from
neighboring text.

-Jeff
___
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] extract page title

2007-04-24 Thread Andreas Jung



--On 24. April 2007 15:40:22 +0100 Dean Hale [EMAIL PROTECTED] 
wrote:




Hi Andreas,

Thanks - i know the title does not belong in a script tag, i just want
the text within the title tag appended within the javascript, not the
tags themselves. Sorry its my explanations for help that are unclear.

thanks
dan



Move your code to generate the HTML snippet into a script and generate
whatever you need on the Python level. If you generate the title
using TALES, you can use the same API in Python to generate the title
inside your script code. Then call the script from the template.

-ajh

pgpSMfR4EuI6U.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] extract page title

2007-04-24 Thread Maciej Wisniowski

 Hi Andreas,

 Thanks - i know the title does not belong in a script tag, i just want
 the text within the title tag appended within the javascript, not the
 tags themselves. Sorry its my explanations for help that are unclear.


I'm not sure if I understand you but...
Where title tag content came from? If this is from typical title_or_id
function then
you may use something like:

title tal:content=here/title_or_id/title 

you may then also do:

img tal:attributes=src python:
'http://domain/xxx/xxx/s?websitename.%s' % (here.title_or_id())
width=1 height=1 alt=

-- 
Maciej 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] extract page title

2007-04-24 Thread Philip Kilner
Hi Dean,

Dean Hale wrote:
 I'm trying to implement some web tracking code within a page template,
 however a little stuck.
 
 In the code below i'd like to append the page template - page title
 between the title tags dynamically rather than having to manually add
 to each page
 
 script language='JavaScript1.1' type='text/javascript' 
 noscript 
 img src=http://domain/xxx/xxx/s?websitename.PAGETITLE;  
 width=1 height=1 alt= 
 /noscript 
 /script
 
 do you have any advise please on how this could be done?
 

I've re-read this thread about four times now, and am having a lightbulb
moment.

Do you mean that you wish to dynamically form the tag: -

img
  src=http://domain/xxx/xxx/s?websitename.PAGETITLE;
  width=1
  height=1
  alt=

...such that PAGETITLE is the title of the current page?

If so, you need to bone up on tal:attributes, because you need to do
something like: -

img
  tal:attributes=src string:http://url?sitename.${here/title_or_id};
  src=http://domain/xxx/xxx/s?websitename.PAGETITLE;
  width=1
  height=1
  alt=

(Untested - but you get the idea)

HTH

-- 

Regards,

PhilK
___
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] extract page title

2007-04-24 Thread Andreas Jung



--On 24. April 2007 09:56:41 -0500 Jeff Rush [EMAIL PROTECTED] wrote:



I don't see above him putting a title tag within the script tag.  He
wants to put the *value* of the title tag inside the script tag.  It
seems some form of a string: expression would do it, assuming the title
is not literally in the zpt but rather expanded from a variable.

script language='JavaScript1.1' type='text/javascript'
 noscript
img tal:attributes=src
http://domain/xxx/xxx/s?websitename.${title_or_id};  width=1
height=1 alt= /
/noscript
/script



As far as I can recall: you can't use TALES within a SCRIPT block.
That's why you must generate your stuff outside inside a script.

-aj

pgpeYM5aT89ds.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] extract page title

2007-04-24 Thread Jeff Rush
Andreas Jung wrote:
 
 As far as I can recall: you can't use TALES within a SCRIPT block.
 That's why you must generate your stuff outside inside a script.

Ah thanks I wasn't aware of that exclusion, never having tried it or found it
documented.  Then yes your approach is the only one left.

-Jeff

___
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] extract page title

2007-04-24 Thread Andreas Jung



--On 25. April 2007 00:41:19 -0500 Jeff Rush [EMAIL PROTECTED] wrote:


Andreas Jung wrote:


As far as I can recall: you can't use TALES within a SCRIPT block.
That's why you must generate your stuff outside inside a script.


Ah thanks I wasn't aware of that exclusion, never having tried it or
found it documented.  Then yes your approach is the only one left.



The reason is obvious: Usually you don't have any markup with 
script../script. Still not getting why generate img within a script 
tag...appears like broken-by-design to me...but I don't care.


-aj

pgp4JeWb9mfaB.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 )