Hello list, I have a database with a table full of customers and one of the fields in the database contains the customer's website. I have a ZSQL method that gets the data then a Page Template. The part of the Page Template that renders the web page is as follows <p>Webpage: <a tal:attributes="href rdata/webpage" tal:content="rdata/webpage">webpage</a> </p> Now if I view this in a web browser it takes me to this link http://my_ip_address:8080/plone_instance/the_url_i_want_it_to_take_me_to (eg www.foo.com <http://www.foo.com/> ) How do I stop it putting the plone instance in front of my webpage? Thanks Tim Zegir
Tim Zegir wrote:
I have a database with a table full of customers and one of the fields in the database contains the customer’s website.
I have a ZSQL method that gets the data then a Page Template.
The part of the Page Template that renders the web page is as follows
<p>Webpage:
<a tal:attributes="href rdata/webpage" tal:content="rdata/webpage">webpage</a>
</p>
Now if I view this in a web browser it takes me to this link http://my_ip_address:8080/plone_instance/the_url_i_want_it_to_take_me_to (eg www.foo.com <http://www.foo.com/>)
How do I stop it putting the plone instance in front of my webpage?
Basic HTML behaviour is your culprit. I bet if you look at the source you'll find it looks like:: <a href="www.foo.com">www.foo.com</a> Problem is this looks to the web browser like an address relative to the current URL path. You must always have a protocol in an external link. So you can fix the source of the data or say:: <a tal:attributes="href string:http://${rdata/webpage}" tal:content="rdata/webpage">webpage</a> That should do the trick. --jcc -- "My point and period will be throughly wrought, Or well or ill, as this day's battle's fought."
Thank you, it now works. Tim -----Original Message----- From: J. Cameron Cooper [mailto:jccooper@jcameroncooper.com] Sent: Thursday, 11 December 2003 2:16 PM To: Tim Zegir Cc: zope@zope.org Subject: Re: [Zope] URL Hell Tim Zegir wrote:
I have a database with a table full of customers and one of the fields
in the database contains the customer's website.
I have a ZSQL method that gets the data then a Page Template.
The part of the Page Template that renders the web page is as follows
<p>Webpage:
<a tal:attributes="href rdata/webpage" tal:content="rdata/webpage">webpage</a>
</p>
Now if I view this in a web browser it takes me to this link
http://my_ip_address:8080/plone_instance/the_url_i_want_it_to_take_me_to
(eg www.foo.com <http://www.foo.com/>)
How do I stop it putting the plone instance in front of my webpage?
Basic HTML behaviour is your culprit. I bet if you look at the source you'll find it looks like:: <a href="www.foo.com">www.foo.com</a> Problem is this looks to the web browser like an address relative to the current URL path. You must always have a protocol in an external link. So you can fix the source of the data or say:: <a tal:attributes="href string:http://${rdata/webpage}" tal:content="rdata/webpage">webpage</a> That should do the trick. --jcc -- "My point and period will be throughly wrought, Or well or ill, as this day's battle's fought."
participants (2)
-
J. Cameron Cooper -
Tim Zegir