Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Named Anchors

Status
Not open for further replies.

ziwacky

Programmer
Jun 27, 2000
43
US
How do one implement a "named anchor" in coldfusion to make sort of an index for a page.

I know you need this:

<a href=&quot;#YourFirstIndex&quot;>First Index</a>

.
.
.

First Index <a name=&quot;YourFirstIndex&quot;></a>

I am using a variable, instead of 'YourFirstIndex' constant.
How do I use it in the <a href> tag without it breaking.

Thx,

Z
 
Is this what you need?

<cfset YourFirstIndex = &quot;index.html&quot;>
<cfoutput>
<a href=&quot;#YourFirstIndex#&quot;>First Index</a>
</cfoutput>

The only things I see you needed were an extra pound sign and the cfoutput tags.

Hope this helps,
GJ
 
No, that isn't. But thanks for the suggestion. What I need is bookmark different spots in the same page. Like for example, I have x numbers of books I want to display in my page. Each book has a title and description. This are being pulled from a database, so this are going to be dynamic.

At the top of my page I need a list of the book titles that when clicked will link to the spot where that book title and description is.

Since I need to use a variable in the referrer link, and this link requires a pound sign, I can't insert my variable using the two pound signs and avoid it breaking.

 
never mind. I just got it.

For those who may use it later,

<a href=&quot;###yourvariable#&quot;>Link me now</a>
 
Lol, I'm sorry, I didn't read your post carefully. You said &quot;named anchor&quot; and I read it as &quot;link&quot; :)

GJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top