Monday, April 17, 2017

Drupal - Creating Anchors in your Articles

Note: This post uses CKEditor in Drupal as the WYSIWYG editor.

The web term is called an "anchor". A place in the web page that marks a section of the page that you can jump to.

When editing the Medical Article Summary, place your cursor at the location you want the anchor. Then click the FLAG icon in the editor (see screenshot).



After clicking the FLAG icon (Anchor), a popup will show asking what you want to call it. Use any name you want with no spaces.



I used the name "anchor1".

Now if I want to automatically jump to this section when I go to view the article, I just append the anchor (with the '#’ symbol).

So what was before: https://example.com/article/test
Now becomes:          https://example.com/article/test#anchor1


This is also how Table of Contents are done on a web page, by having a list of items that you can jump to.


You can have multiple anchors within a web page, but they need to be unique within that web page. In this page, I could not have 2 anchors named "anchor1" or else we don’t know where to jump. However I could have "anchor1" in one article and then "anchor1" in a completely different article.

6 comments:

  1. https://www.visualaidscentre.com/service/eyes-specialist-delhi/ People think of their homes in different ways. The old adage - a man's home is his castle - can be true for many men and women. Your home is also likely to be your biggest investment and as such it is deserving of continued upgrade to increase the home improvement value of your investment.

    ReplyDelete
  2. https://www.visualaidscentre.com/lasik-eye-surgery-in-delhi/ Games like World of Warcraft, and RuneScape have an overflow of players that makes newcomers feel that they jumped on the boat too late. Why start playing a game 5 or 6 years after the game has been developed and you have all these guys with super crazy armor and swords that can take down armies of thousands.

    ReplyDelete
  3. https://onohosting.com If you're really into computer or video games, you'll want to check out these tips to stay informed of gaming industry news. This is practical advice you won't find elsewhere.

    ReplyDelete