Skip to main content
Participant
June 18, 2013
Question

Dreamweaver CC Named Anchor Tag Missing?

  • June 18, 2013
  • 2 replies
  • 94111 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
MoonieAuthor
Participant
June 19, 2013

Hi Nancy,

Thank you for your response, and example code.

While I unerstand that it is possible, even simple, to hand code the obsolete 'Anchor' code ... my question to Adobe is why remove the facility to insert 'Anchor' code without creating a replacement facility in DWCC.

I understood that the reason for using Dreamweaver was to benefit from the various coding features it provides.

To me, this seems a very retrograde step on their part. Particularly when their cost of their latest business model is supposed to be negated by the addition of simplified and 'Added Value' services and facilities.

Cordially,

Colin.

Jon Fritz
Community Expert
Community Expert
June 19, 2013

The reason it was removed is there is absolutely no reason for it anymore, it was dropped from html back in HTML4. Using an anchor tag in this manner is just not necessary. The "new" way is much more flexible and IIRC, takes one less step in Design View and ultimately creates leaner code (faster downloads, albeit only slightly).

To make a link that goes to a specific spot in your page, you only need to know the html id of the element you want to link to.

In Nancy's example, all you do from the Design View of DW is highlight the text/image you want to turn into a link and enter #foo as the link itself and you get the exact same affect as putting a Named Anchor in the beginning of the <div id="foo"> and then adding a link to it.

If  you want to add more "anchors" within a long single container (a list of Q&A for example), you can highlight any text/image in Design View and then in the Properties inspector, add an ID. That will create a set of <span> tags around the text/image with an html id that you can reference  by simply adding #the_id_name to the Link field in the Properties inspector.

So instead of making the page, then adding anchors, then linking to them, you can make the page and link to the ids of the elements on the page, any element, not just <a> tags.