PUBLIE : Using anchor links in SPIP

**SPIP**

# Article validé

L’article "**Using anchor links in SPIP**
(https://www.spip.net/en_article6590.html)" vient d’être publié par
<multi>[ar]جورج[fr]George [en]George</multi>.

* * *

## Using anchor links in SPIP

الأربعاء 30 أيلول (سبتمبر) 2020 , بقلم
[jack](.././?page=auteur&id_auteur=593&)

## الفهرس

* Step 1: create the anchor link
* Step 2: create a link towards this anchor link

This article is a small memo to use anchor links in SPIP articles.

Anchor links are invisible markers that can be placed in a text. They allow
direct access to a specific area in a page, which can be useful to refer
users to a paragraph in a very long page.

## Step 1: create the anchor link[|عودة الى
الفهرس](#s-Step-1-create-the-anchor-link)

Here is the SPIP shortcut to place an anchor link

    [anchor_link_name<-]

That is:

* The anchor link must be **unique**. You can’t have multiple anchor
links named *"menu"* on the same page.
* The anchor link **must not contain** space and if possible avoid
accents and special characters.

For example on this paragraph "step 1", here is my code:

    [step-1<-]

    {{{Step 1: create the anchor link}}}

## Step 2: create a link towards this anchor link[|عودة الى
الفهرس](#s-Step-2-create-a-link-towards-this-anchor-link)

Here is the SPIP shortcut to link to an anchor link in a page.

    [->#anchor_link_name]

The **#** character is a reserved character that means anchor link.
It is automatically added to the address when the anchor link is
clicked.<figure class='spip\_document\_2986 spip\_documents
spip\_document\_image spip\_documents_center' style='width:347px;'>
</figure>

Here are some examples

**Crate the link towards this anchor link**

    [Hypertext link title ->#anchor_link_name]

    [Reviewing step 1->#step-1]

Which gives: Reviewing step 1

**Create link to anchor link to another SPIP item**

    [Hyperlink title->spip_article_number#anchor_link_name]

    [View Mathematical Filters->2465
    
    #M
    
    athematical-filters]

Which gives: View Mathematical Filters
(https://www.spip.net/ecrire/?exec=article&id_article=2465#Mathematical-filters)

— Envoyé par SPIP (https://www.spip.net/)

rubon209-6a36e.jpg