This topic is locked

Format Options - Hyperlinks

6/7/2003 2:02:38 PM
ASPRunnerPro General questions
D
dlguild author

I like this product a great deal, I went ahead and purchased it. It is well worth the money. I do, however, have a question (to which, if there is no easy answer, it may be a suggestion).
All of our databases are set up to store hyperlinks and image files relative to the site root directory so that it is not necessary to add the complete URL into the data record. Our ASP pages append the Server.MapPath variable to data record automatically. Is there a way to tell the system while setting up the field format options (hyperlink or image file) that the field data will be relative to the site root directory, not the current directory, for display purposes on the edit page?
For example, our products database contains a field to store the product image. The data in the field looks like this:
products\images\<specific product image file>
Our ASP pages read this data and prefix it with <%= pathRoot %> (The pathRoot variable is set to Server.MapPath + '\'), which results in the full path to the image, say c:\mysite\products\images\<specific product image file>
Thanks in advance for your assistance.

admin 6/7/2003

Hi,
You can change the way you define image path in your database this way:
/products/images/<specific product image file>
You dont have to prefix it with <%= pathRoot %> in this case.
You can see similar example here:

http://www.xlinesoft.com/asprunner/article...arger_image.htm
Best regards,

Sergey Kornilov

D
dlguild author 6/8/2003

Hi Sergey,
Thanks for your prompt reply. I apparently have not made myself clear. I will attempt to better explain. Our site structure looks like this:
http://mysite/datafiles/products.mdb - stores product information, including image file reference relative to the root folder, for example: /products/images/<product image file>. The 'datafiles' directory stores all our mdb files.
http://mysite/products/images/<product image file> - contains product image files
http://mysite/updates/ - password protected folder, with subfolder for each mdb datafile maintained by ASPrunner.
http://mysite/updates/default.asp - provides 'update' menu
http://mysite/updates/products/ - contains files generated by ASPrunner program to maintain products.mdb
ASPrunner generates (on the edit page) the image reference which looks like this <img src="/products/images/<product image file>">, which is incorrect since this translates into "http://mysite/updates/products/products/images/<product image file>". In other words, since this reference is relative to the current directory, it does not exist. It should be relative to the root directory.
This is true in the code produced by ASPrunner for both hyperlinks and image links. We have many datafiles, with 10's of thousands of records, all of which store image and hyperlink references relative to the root directory. Our ASP code is designed to make the proper translation. To change all that code, as well as all our link references is just not an option. I was hoping there was a way to make ASPrunner generate code which dealt with links relative to the sites' root directory. For now, I will not format any fields as 'hyperlink' or 'image', since these don't produce viable links in our situation.
To better understand our site structure, see http://www.skcgulfcoast.com. The entire site is database driven.
Thanks,

Dan Guild

admin 6/9/2003

Dan,
here is what you can try:
when you build ASP pages with ASPRunner you can modify default SQL query

select

...

'../' + imagepath as newimagepath,

...

from ...


This will build HTML code like this:

http://mysite/updates/products/../products/images/<product image file>

which points to required image file.
I hope this helps.
Sergey Kornilov

D
dlguild author 6/11/2003

Thanks Sergey! Worked great!
Dan