Aligning Images With Text
Here is my code: <dtml-if "_[ProgCode + 'PIC']"> <dtml-var "_[ProgCode + 'PIC']"> </dtml-if> What I would like to do is align the picture to the right of my web page. If I was programming html I would do it like this: <img src=T043PIC align=right> Any help? Terry -- __________________________________________________________________ Terry Babbey Technical Support Specialist Lambton College, Sarnia, Ontario, Canada __________________________________________________________________
Terry Babbey wrote:
Here is my code: <dtml-if "_[ProgCode + 'PIC']"> <dtml-var "_[ProgCode + 'PIC']"> </dtml-if>
You might create a dtml variable with a dtml call, e.g., <dtml-call "REQUEST.set('image1', _[ProgCode + 'PIC']"> Then use your image html tag as <img src="<dtml-var image1>" align="right"> ciao! greg.
What I would like to do is align the picture to the right of my web page. If I was programming html I would do it like this: <img src=T043PIC align=right>
Any help? Terry
-- __________________________________________________________________ Terry Babbey Technical Support Specialist Lambton College, Sarnia, Ontario, Canada __________________________________________________________________
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
I get an error message when I try your code. Expression (Python) Syntax error: unexpected EOF while parsing , for tag <dtml-call "REQUEST.set('image1', _[ProgCode + 'PIC']">, on line 32 of display_html Gregory Haley wrote:
Terry Babbey wrote:
Here is my code: <dtml-if "_[ProgCode + 'PIC']"> <dtml-var "_[ProgCode + 'PIC']"> </dtml-if>
You might create a dtml variable with a dtml call, e.g.,
<dtml-call "REQUEST.set('image1', _[ProgCode + 'PIC']">
Then use your image html tag as
<img src="<dtml-var image1>" align="right">
ciao! greg.
What I would like to do is align the picture to the right of my web page. If I was programming html I would do it like this: <img src=T043PIC align=right>
Any help? Terry
-- __________________________________________________________________ Terry Babbey Technical Support Specialist Lambton College, Sarnia, Ontario, Canada __________________________________________________________________
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- __________________________________________________________________ Terry Babbey Technical Support Specialist Lambton College, Sarnia, Ontario, Canada __________________________________________________________________
On Wed, 12 Jul 2000, Terry Babbey wrote:
Here is my code: <dtml-if "_[ProgCode + 'PIC']"> <dtml-var "_[ProgCode + 'PIC']"> </dtml-if>
What I would like to do is align the picture to the right of my web page. If I was programming html I would do it like this: <img src=T043PIC align=right>
Untested, but I copied most of it from a working method: <dtml-var "_.getitem('ProdCode' + 'PIC',0).tag(align='right')"> --RDM
This worked. Now if only I could get my dtml-if statement working. Thanks, Terry "R. David Murray" wrote:
On Wed, 12 Jul 2000, Terry Babbey wrote:
Here is my code: <dtml-if "_[ProgCode + 'PIC']"> <dtml-var "_[ProgCode + 'PIC']"> </dtml-if>
What I would like to do is align the picture to the right of my web page. If I was programming html I would do it like this: <img src=T043PIC align=right>
Untested, but I copied most of it from a working method:
<dtml-var "_.getitem('ProdCode' + 'PIC',0).tag(align='right')">
--RDM
-- __________________________________________________________________ Terry Babbey Technical Support Specialist Lambton College, Sarnia, Ontario, Canada __________________________________________________________________
On Wed, 12 Jul 2000, Terry Babbey wrote:
Now if only I could get my dtml-if statement working.
<dtml-if "_[ProgCode + 'PIC']">
I believe this should work (mostly tested): <dtml-if "_.has_key(ProgCode + 'PIC')"> Note that this will be true if the id exists anywhere in the acquisition path. --RDM
Thanks again. Works! "R. David Murray" wrote:
On Wed, 12 Jul 2000, Terry Babbey wrote:
Now if only I could get my dtml-if statement working.
<dtml-if "_[ProgCode + 'PIC']">
I believe this should work (mostly tested):
<dtml-if "_.has_key(ProgCode + 'PIC')">
Note that this will be true if the id exists anywhere in the acquisition path.
--RDM
-- __________________________________________________________________ Terry Babbey Technical Support Specialist Lambton College, Sarnia, Ontario, Canada __________________________________________________________________
I posted a similar question, but unfortunatly no response on that one. I haven't done it yet, but I guess you could simply change the Image product so that it can handle another parameter. If you use .tag you can only control ALT, HEIGHT, WIDTH and BORDER Look for these things in the Image module and see if you can add ALIGN. Good luck. Please keep us posted if any success. :) ----- Original Message ----- From: Terry Babbey <terry@lambton.on.ca> To: <zope@zope.org> Sent: Wednesday, July 12, 2000 8:24 PM Subject: [Zope] Aligning Images With Text
Here is my code: <dtml-if "_[ProgCode + 'PIC']"> <dtml-var "_[ProgCode + 'PIC']"> </dtml-if>
What I would like to do is align the picture to the right of my web page. If I was programming html I would do it like this: <img src=T043PIC align=right>
Any help? Terry
-- __________________________________________________________________ Terry Babbey Technical Support Specialist Lambton College, Sarnia, Ontario, Canada __________________________________________________________________
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
On Wed, 12 Jul 2000, Peter Be wrote:
If you use .tag you can only control ALT, HEIGHT, WIDTH and BORDER Look for these things in the Image module and see if you can add ALIGN.
As far as I can see from the source, tag should handle arbitrary arguments. The comments certainly say that it does. This is as of 2.1.4, at least. --RDM
Image objects have a tag method for setting all the HTML tags: Try something like (untested): <dtml-var "yourimageID.tag(align='right')"> ... or tested (from one of my sites): <dtml-var "ClearDot.tag(width='25')"> -- HTH -- Loren ----- Original Message ----- From: "Terry Babbey" <terry@lambton.on.ca> To: <zope@zope.org> Sent: July 12, 2000 12:24 PM Subject: [Zope] Aligning Images With Text
Here is my code: <dtml-if "_[ProgCode + 'PIC']"> <dtml-var "_[ProgCode + 'PIC']"> </dtml-if>
What I would like to do is align the picture to the right of my web page. If I was programming html I would do it like this: <img src=T043PIC align=right>
Any help? Terry
-- __________________________________________________________________ Terry Babbey Technical Support Specialist Lambton College, Sarnia, Ontario, Canada __________________________________________________________________
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Hi, I was able to install and test the ZBabel product. Very nice product indeed!! I have a question about performance.. I saved the translated text into an MySQL database, and ZBabel automatically inserted the text to be translated into the database, I went ahead and translated the text, and bingo it magically appeared as translated. However my concern that if the page is accessed by thousands of people, does Zope cache the translated text and serve it? does ZBabel do that? or is there a way to do that? I do not want to hit the database everytime someone requests that page.. Our site is usually translated to 5 languages and we had developed a Perl script that would read php tags and create static pages becuase of that problem, and in this case we do not know at all what happend in eth backend.. Thanks in advance.. Adonis -- Adonis El Fakih - President, CEO -- EGS, Inc. 70 Boston Road, Suite A301, Chelmsford MA 01824 USA Fax (978) 244-0544 - adonis@egsx.com
+----[ technews@egsx.com ]--------------------------------------------- | Hi, | | I was able to install and test the ZBabel product. | Very nice product indeed!! I have a question about performance.. Thanks :-) [...snip...] | However my concern that if the page is accessed by thousands | of people, does Zope cache the translated text and serve it? does ZBabel | do that? or is there a way to do that? If you are passing query_string parameters into your page you will not be able to cache the pages anyway. If a page is cacheable then you can setup a HTTP accellerator in front of Zope that will cache the rendered pages. I don't know what your current network topology is like, so it's a little hard to comment. I can look at adding caching into ZBabel, but, it's not high on my priority list at the moment... I'm currently pounding the bricks. I'll try to make time over the weekend to have a look (I may be able to use the Zope Machinery to do the caching). | I do not want to hit the database | everytime someone requests that page.. Our site is usually translated to 5 | languages and we had developed a Perl script that would read php tags and | create static pages becuase of that problem, and in this case we do not | know at all what happend in eth backend.. Out of interest how many hits per hour are you doing? I worked on a largish portal system (ASP *puke*) and they had no problem going to the DB very very frequently. The key for the phrase is 32 bytes, it should be very quick to look up, even in a poorly tuned MySQL. -- Totally Holistic Enterprises Internet| P:+61 7 3870 0066 | Andrew Milton The Internet (Aust) Pty Ltd | F:+61 7 3870 4477 | ACN: 082 081 472 ABN: 83 082 081 472 | M:+61 416 022 411 | Carpe Daemon PO Box 837 Indooroopilly QLD 4068 |akm@theinternet.com.au|
For non-cacheable pages that can't be speeded up by a reverse proxy, there might be two other possibilities worth looking at as well. If Zbabel is mainly needed for the production/maintenance of translations rather than for really dynamic pages it might be possible to use ZMirror for semi-static per language templates generated by ZBabel that get combined dynamically with the dynamic non-translated bits. For really dynamic translations, if the database hits are still too much for some users, despite being read only and therefore usually in buffers, it might be possible to copy the maintenance ZBabel database stored in a persistent SQL database from the management screens into a RAM Gadfly database used by the actual page generation. -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Andrew Kenneth Milton Sent: Friday, July 21, 2000 10:31 AM To: technews@egsx.com Cc: zope@zope.org Subject: Re: [Zope] ZBabel performance?? +----[ technews@egsx.com ]--------------------------------------------- | Hi, | | I was able to install and test the ZBabel product. | Very nice product indeed!! I have a question about performance.. Thanks :-) [...snip...] | However my concern that if the page is accessed by thousands | of people, does Zope cache the translated text and serve it? does ZBabel | do that? or is there a way to do that? If you are passing query_string parameters into your page you will not be able to cache the pages anyway. If a page is cacheable then you can setup a HTTP accellerator in front of Zope that will cache the rendered pages. I don't know what your current network topology is like, so it's a little hard to comment. I can look at adding caching into ZBabel, but, it's not high on my priority list at the moment... I'm currently pounding the bricks. I'll try to make time over the weekend to have a look (I may be able to use the Zope Machinery to do the caching). | I do not want to hit the database | everytime someone requests that page.. Our site is usually translated to 5 | languages and we had developed a Perl script that would read php tags and | create static pages becuase of that problem, and in this case we do not | know at all what happend in eth backend.. Out of interest how many hits per hour are you doing? I worked on a largish portal system (ASP *puke*) and they had no problem going to the DB very very frequently. The key for the phrase is 32 bytes, it should be very quick to look up, even in a poorly tuned MySQL. -- Totally Holistic Enterprises Internet| P:+61 7 3870 0066 | Andrew Milton The Internet (Aust) Pty Ltd | F:+61 7 3870 4477 | ACN: 082 081 472 ABN: 83 082 081 472 | M:+61 416 022 411 | Carpe Daemon PO Box 837 Indooroopilly QLD 4068 |akm@theinternet.com.au| _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
+----[ technews@egsx.com ]--------------------------------------------- Snip... | translated. However my concern that if the page is accessed by thousands | of people, does Zope cache the translated text and serve it? does ZBabel I've added caching of phrase lookups using the ZSQL Methods caching facilties, it should cache up to 1,000 different phrases for 60 seconds. There is a 0.0.2 release on zope.org now. http://www.zope.org/Members/TheJester/ZBabel/ -- Totally Holistic Enterprises Internet| P:+61 7 3870 0066 | Andrew Milton The Internet (Aust) Pty Ltd | F:+61 7 3870 4477 | ACN: 082 081 472 ABN: 83 082 081 472 | M:+61 416 022 411 | Carpe Daemon PO Box 837 Indooroopilly QLD 4068 |akm@theinternet.com.au|
Wow!
From 1) to 2) - both you and Zope DELIVER
1) "I can look at adding caching into ZBabel, but, it's not high on my priority list at the moment... I'm currently pounding the bricks. I'll try to make time over the weekend to have a look (I may be able to use the Zope Machinery to do the caching)." Sent: Fri 7/21/00 10:31 AM 2) I've added caching of phrase lookups using the ZSQL Methods caching facilties, it should cache up to 1,000 different phrases for 60 seconds. There is a 0.0.2 release on zope.org now. http://www.zope.org/Members/TheJester/ZBabel/ Sent: Fri 7/21/00 1:56 PM -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Andrew Kenneth Milton Sent: Friday, July 21, 2000 1:56 PM To: technews@egsx.com Cc: zope@zope.org Subject: Re: [Zope] ZBabel performance?? +----[ technews@egsx.com ]--------------------------------------------- Snip... | translated. However my concern that if the page is accessed by thousands | of people, does Zope cache the translated text and serve it? does ZBabel I've added caching of phrase lookups using the ZSQL Methods caching facilties, it should cache up to 1,000 different phrases for 60 seconds. There is a 0.0.2 release on zope.org now. http://www.zope.org/Members/TheJester/ZBabel/ -- Totally Holistic Enterprises Internet| P:+61 7 3870 0066 | Andrew Milton The Internet (Aust) Pty Ltd | F:+61 7 3870 4477 | ACN: 082 081 472 ABN: 83 082 081 472 | M:+61 416 022 411 | Carpe Daemon PO Box 837 Indooroopilly QLD 4068 |akm@theinternet.com.au| _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (8)
-
Albert Langer -
Andrew Kenneth Milton -
Gregory Haley -
Loren Stafford -
Peter Be -
R. David Murray -
technews@egsx.com -
Terry Babbey