Skip to main content
Participant
June 18, 2013
Question

Dreamweaver CC Named Anchor Tag Missing?

  • June 18, 2013
  • 2 replies
  • 94150 views

Insert > Named Anchor

This command has been removed. Does it exist elswhere, or does one have to hand code the HTML in DWCC?

This topic has been closed for replies.

2 replies

Inspiring
December 11, 2013

Historically,  I’ve avoided using named anchors, and I think my reasons may extend to the updated "link to ID" method discussed on this thread. 

If I recall correctly, over 5 years ago I did some experiments and determined that positioning on "short"  target pages isn't satisfactory.  The linked-to anchor point may not --cannot?-- be positioned at the top of the page.  (Maybe this has been improved in recent years... if so, please post back with a few words of explanation.)  In such cases, there seems to be no way of directing the visitors attention to the exact target, which I saw as a strong reason to avoid this technique.

A recent reason to re-examine this:  I now need to provide a master glossary page for groups of pages. The referring text should lead directly to the relevant definition in all cases.     Visitors may choose to ignore links on technical terms, to follow links in specific cases, or to visit the glossary page to study multiple terms in parallel.

Fast forward: I found this thread.

- - -

As a greybeard, especially, I understand the point raised by some in this thread:  change IS difficult.  For me, forgetting the old method and now identifying the link target by ID is easy.  I didn't use the old method, and the new one seems logical and forward-looking. 

- - -

From now on, how might a DW user go about managing multiple  link targets in a page?

A basic: seeing the targets.   As I recall, in past versions of DW, one could make named anchors visible in Design View  as a colored shield.   Is this still possible?  Does it apply to the old method of indicating link targets, the new, or both?  I set up test instances of both in a page.  In DW CC, I went to Preferences --> Invisible Elements  and I checked ALL boxes.   Nope,  lots of invisibles now visible, but no corresponding shield for either type of target.  Am I missing something?   Is there another setting? 

If there’s no visibility of IDs in Design View, and DW CC doesn’t offer any other link-target management, some of us can use Code View.  I can see exploring what’s allowed in IDs  (in 4.01 Transitional —what I’m using now— and the future) and coming up with a personal naming standard I can use to make it easier to “see” IDs I intend  as link targets.    Better than nothing, but doesn’t seem particularly efficient.

Generally, this seems like extra trouble and applicable only to people who are  comfortable with Code View.  I get the idea that using named targets has not been strongly supported in the past, and seems on the edge of being deprecated now.     Is that correct?  

Are there a simple alternative methods for achieving the same result?  

TIA

Nancy OShea
Community Expert
Community Expert
December 11, 2013

You can keep using named anchors (manually) in HTML 4 docs.  But they are definitely deprecated in HTML 5 docs.

The linked-to anchor point may not --cannot?-- be positioned at the top of the page.  (Maybe this has been improved in recent years... if so, please post back with a few words of explanation.) 

Nothing has changed.  It all depends on the length of the page and the size of your end-user's screen.

Alternatives:

jQuery scripts.  This one uses jQuery Smooth Scrolling.

http://alt-web.com/TEMPLATES/FixedLayout.shtml

Or, use jQuery Fancybox with Ajax or inline content that appears inside a modal window.

http://fancyapps.com/fancybox/

Nancy O.

Nancy O'Shea— Product User & Community Expert
Inspiring
December 12, 2013

Nancy O: Thanks for the confirmation that nothing has changed.   Though I'm using HTML 4, I definitely want to be aware of what's coming. 

And thanks for the suggestions!  I'll check those out as long-term alternatives.   It looks like using either will take a bit of study, and an amount of modification yet TBD.   Simple?   I guess I'll find out. 

Nancy OShea
Community Expert
Community Expert
June 18, 2013

Named anchors are deprecated since HTML4.  It's much simpler to use Div IDs in your markup:

     <div id="foo">

          Some content here....

     </div>

Then link to the ID on the same page like this:

     <a href="#foo">Some Link</a>

Or to a different page like this:

    <a href="pagename.html#foo">Some Link</a>

Nancy O.

Nancy O'Shea— Product User & Community Expert
golf25radioman
Known Participant
July 22, 2013

Nancy O. wrote:

Named anchors are deprecated since HTML4.  It's much simpler to use Div IDs in your markup:

     <div id="foo">

          Some content here....

     </div>

Then link to the ID on the same page like this:

     <a href="#foo">Some Link</a>

Or to a different page like this:

    <a href="pagename.html#foo">Some Link</a>

Nancy O.

So this outdated Anchor command, replaced by the Div ID has no command in the menus?  One has to do code to make it?  I'll admit I don't do much HTML, understand a fair share - enough to get by.  But don't understand why Adobe would delete a menu command and not replace it with what is the current HTML.  I've read your code and it seems to be much more time consuming than a menu command - that seems backwards to me...

Tom

Jon Fritz
Community Expert
Community Expert
July 23, 2013

Sorry but this method just doe snot work for me.   If I select a bit of text or simply place the curor before a word  in design view and in the ID field of the property inspector type an id name,  in code view I see it creates a <strong> tag with that name.  Weird .  Then of course when  linking to that id as per your instructions nothing happens of course because a div tag has not been created. Neither has an a tag been created. Only a strong tag with an id name!   They only way I have found to create anchors that work is to manually code an anchor with  <a id="name">  </a>  and then making a link to that id as per your instructions does work .  So I totally miss the named anchor command.  Either fix the id field in the property inspector, or bring it back, please Adobe.  Or someone tell me why I cannot do as Jon Fritz says.... and why a strong tag is created when using the id field!

Thanks!


You need to have "something" selected, either by clicking an image, highlighting some text or selecting an html element on your page. Sorry, I wasn't as clear as I could have been on that. Doing that will allow you to either see the id already there or add an id to the element or text.

I'm not sure why it would create a set of <strong> tags when you select text and add an ID. It should be a set of <span> tags, if anything, when you select text and add an ID (many times it will select the <p> tag the text is in.

Either way, it definitely doesn't need to be a <div> tag that is linked to with the ID method for anchors. Whatever you link to will end up being the first thing on the page when clicking the link, as long as there is enough room below it to allow for that. If you try to anchor something that is near the bottom of the page, and click the link, it will still be on the bottom unless you add enough space for the browser window to allow it to scroll that element to the top.

Could you post a link to your page, maybe there is something specific in your code that is causing an issue?