• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

DW CS6 Named Anchor edit not working

Explorer ,
Nov 01, 2018 Nov 01, 2018

Copy link to clipboard

Copied

I do very little programming. A couple of years ago I used CS6 to create a personal website that had a FAQs page of questions with links to answer pages. Each link had a leading named anchor so when the answer page was displayed it showed all the questions but started at the question line. This week I updated the site with two new pages. I created the same line structure as before -  

<li><a id="civil"></a><a href="faqs_civil.html#civil">Can Civil Action be Brought Against Me?</a></li>

All the original links work properly. The two new links only go to the top of the new page instead of the named anchor on the new page.

Also, after the first creation didn't work I deleted the line and started again. DW said the previous "name" was already used and I had to use "name2". Next time I had to use "name3". Where are these coming from if I delete the original line?

In my search I read something about a Table of Contents and something else about a List of parts(?) but I can't find anything about these in DW.

I'm still using CS6 so Named Anchors are still in my menus and are inserted.

ANSWER - I don't know why, but when I finally gave in and used "name3" it finally worked right. When I used the old "name" for both the anchor and link it didn't work. When I changed the anchor AND link to the new name, it did. WHY?

This issue is solved, but I'm not a programmer and if someone can explain about the name change requirements it would be appreciated.

Views

391

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 01, 2018 Nov 01, 2018

Copy link to clipboard

Copied

Because we cannot see the code of your document, I will have a guess and say that you have unsuccessfully tried to use the same anchor names on more than one occasion inside your document. The guidelines state that anchor names must be unique within a document.

Having said that, have a look at HTML a name Attribute which states

Translated, a link pointing to an anchor should look like

<a href="#myanchor">Got to My Anchor</a>

and the anchor will look like

<h3 id="myanchor">This is My Anchor</h3>

Like the 'name' attribute, 'id' must have a unique value within the document.

Wappler, the only real Dreamweaver alternative.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 02, 2018 Nov 02, 2018

Copy link to clipboard

Copied

Named anchors are deprecated in HTML.  We use unique IDs now.

<a href="#Ifoo">Link to foo on same page</a>

<a href="page_name.html#bar">Link to bar on another page</a>

<div id="foo">

     This is the content for foo.

</div>

<div id="bar">

     This is the content for bar.

</div>

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 03, 2018 Nov 03, 2018

Copy link to clipboard

Copied

Sorry to both BenPleysier and Nancy OShea. Neither of your answers actually deal with the original post.

The code IS there as

<li><a id="civil"></a><a href="faqs_civil.html#civil">Can Civil Action be Brought Against Me?</a></li>

AND as you can see, there is not  "<a name..." in the code.

Even when I delete the above line and remove ALL reference and use of the anchor name totally from the page, if I try to create a new anchor it requires me to use a new name as "civil2".

Let me restate the question.

"Even when the page code has had any previous use of the anchor name deleted and there are no entries anywhere on the page using the previous name,,,

Where does DW find some record of a previous deleted use and why does it use something that has been deleted to force a new name for a new anchor trying to use a previous name."

The question remains unanswered.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 03, 2018 Nov 03, 2018

Copy link to clipboard

Copied

Some things to try:

  • Do a Ctrl+F to Find OLD anchor name. 
  • Hit F5 to refresh the page.
  • Validate code and fix reported errors.
  • Clear your site cache.
    Deleting a corrupted cache file
Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 03, 2018 Nov 03, 2018

Copy link to clipboard

Copied

LATEST

Like I stated in my previous reply the 'id' attribute must have a unique value within the document. In other words, id="civil" can only be used once in the document.

The HTML <a> element (or anchor element) creates a hyperlink to other web pages, files, locations within the same page, email addresses, or any other URL.

This means that an 'href' attribute must be present otherwise the anchor tag is not a hyperlink.

In your case you have used <a id="civil">. According to the specifications, this is not valid code.

If you are in doubt of what I am saying, please check your code using The W3C Markup Validation Service

PS:

The reason that I initially thought that you were using the 'name' attribute is because of the title of this discussion.

Wappler, the only real Dreamweaver alternative.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines