Link to specific section of a page

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Link to specific section of a page

    I am converting static html files to cfm. One of the links in the html file is
    coded as [url]http:///nextPage.html#section5[/url], sending the user to a specific section
    of the linked page. I've tried a few ways to do this in CF, such as
    [url]http:///nextPage.cfm##section5[/url], but I keep getting errors. Also tried it as a
    CFINCLUDE and CFLOCATION. Is this even possible in CF?

    mc7628 Guest

  2. Similar Questions and Discussions

    1. html link to a specific excel sheet
      Hi, here is my problem: I have a link to an excel-doc. But now I want to heve that link to a specific page of that excel-doc. Is that...
    2. Link to specific Folder
      Using Acrobat 6 - Link question, Is it possible to have a link in a pdf file linking to a folder (not file) in the same directory. Would like...
    3. how to add link to a specific page in a pdf?
      I think (hope) this is a simple question - I have a one page pdf that serves as a table of contents for a separate, larger multi-page pdf. Can I...
    4. How do I link to specific pages in another PDF file?
      But clicking on the links merely opens the target file at page 1, i.e. it won't open at the chosen page within the selected file. If Mr....
    5. ??? on how to link to a specific part of an image
      Hello, The easiest way to do it is to define the anchor namee in Dreamweaver. So ...in Fireworks, include the achor name in your link. For...
  3. #2

    Default Re: Link to specific section of a page

    Sorry, my post was a bit inaccurate. The link is presently coded as <a
    href="nextPage.html#section5"> in the static html. The new link will need to
    read something like <a href="nextPage.cfm##section5">

    mc7628 Guest

  4. #3

    Default Re: Link to specific section of a page

    You only need the double # sign if it's enclosed w/i a <cfooutput> tag.

    Eg)



    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Pound Sign Test</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body>
    <a href="#mylink1">Here is an anchor outside cfoutput</a>
    <br>
    <br>
    <cfoutput><a href="##mylink2">Here is an anchor inside cfoutput</a></cfoutput>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <a name="mylink1" id="mylink1">myLink1</a>
    <br>
    <a name="mylink2" id="mylink2">myLink2</a>
    </body>
    </html>

    BSterner Guest

  5. #4

    Default Re: Link to specific section of a page

    That is fine if the link navigates within the same page. I need to navigate
    from Page A to a specific location within Page B.

    The link in PageA.html:
    <a href="PageB.html#section5">.

    PageB.html code:
    <A NAME="section5">Section 5</a>

    Now both PageA and PageB are now .cfm, and you cannot append '#section5' to
    the URL. It will cause an error.


    mc7628 Guest

  6. #5

    Default Re: Link to specific section of a page

    So if you copy the above code into a new file, name it 'links2.cfm' and change
    the hyperlinks to be...

    <a href="links2.cfm#mylink1">Here is an anchor outside cfoutput</a>
    <br>
    <br>
    <cfoutput><a href="links2.cfm##mylink2">Here is an anchor inside
    cfoutput</a></cfoutput>

    You get an error? Javascript error or CF error. It worked just fine for me.

    BSterner Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139