CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Relative path of <img src= > not resolved in included {Header}

Print topic Send  topic

Author Message
davek

Posts: 1
Posted: 01/20/2004, 4:47 PM

This is a restatement of a post in the PHP forum.

When a new page is created the {Header} {Footer} are automatically added.

The Page path of the Header.cpp (ie ../../Header.cpp) file is adjusted to reflect the relative location of the new page to the root.

The problem is that any image path (<img src="images/Logo.gif"> ) in Header.cpp is not adjusted to reflect the relative location of this page to the root.

Any work around for this apart from coping Header.cpp and adjusting the img src= path to reflect the relative location of a page to the root.?
View profile  Send private message
peterr


Posts: 5971
Posted: 01/20/2004, 6:22 PM

An image is pretty much a piece of static HTML that points to a physical image file. By default it should be relative to the current page, uless you edit your HTML and point to a different image location. The static HTML is preserved exactly as designed at all times.

If you like to use includable pages with images on two levels then you may need to:
a) Create two separate includable pages
b) Handle your images dynamically - for example by using a Label instead of an image, then programmatically create the appropriate <img src> tags.
c) Use <base> HTML tag in your Header to point to some specific URL as the base, for example:
<base href="http://www.myweb.com">
However this may affect your images on your parent pages, thus you may need to reset the base URL 2nd time, to match your current page level. It may be best to use JavaScript to set the value of the <base> tag automatically, before your header images and after.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.