This topic is locked

displaying text insted of the hyperlink path

2/17/2004 12:09:05 PM
ASPRunnerPro General questions
author

I would like to manipulate the code so:

  1. insted of the hyperlink path displayed in the hyperlink's field, so another consistent text will appear. for example: if in the field in the database entered the link "http://www.asprunner.com/"; so the linked text in the _list page won't be the path itself but the word "link" . how to do that?
  2. another field's text will be the hyperlinked text of the path in another field. for example, I have field of ID and field of link (and few more fields..), what I want is that the ID will be linked to the site of which the URL stored in the link field. how to do that?
    Hope that I'm clear..

    Thanks in advance.

Sergey Kornilov admin 2/19/2004

Here is what you can do:

  1. Open ..._list.asp file in text editor and find Function loopRS. Find a section of code that displays field with hyperlink. Usually it looks like this:
    Response.Write ProcessLargeText(GetData(rsData.Fields("HyperlinkField"), "Hyperlink"))


2. If you like to display some text instead of full URL change it to:

Response.Write "<a href=""" & GetData(rsData.Fields("HyperlinkField"), "") & """>Some text here</a>"


3. If you like to display some text instead of full URL change it to:

Response.Write "<a href=""" & GetData(rsData.Fields("HyperlinkField"), "") & """>" & GetData(rsData.Fields("AnotherField"), "") & "</a>"


I hope this helps.

501005 2/22/2004

Perfect,
Thanks much.

501006 2/23/2004

another little question in addition to that:

That way yhe linked text is always displayed. how to write a condition statement so the text will be displayed only if the field that holds the hyperlink has content, and if it's null - the text in the _list page won't apear?
Thanks a lot

501007 10/13/2004

I would like to renew the question and change it a little bit:
In the way you suggested, the linked text is always displayed. I want that when the field that holds the hyperlink has specific value (for example the word "File/" - partial reference that I want to put in the hyperlink field as default), no text will be displayed in the _list page, and if the field of the hyperlink holds any other value (hyperlink) a specific word will be displayed instead the full URL.
How to do that?
Thanks a lot