Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

How to create in-page anchor

Started by Carlos 5 years ago · 7 replies · 472 views
5 years ago

Mi pregunta tiene que ver con los vínculos en la misma pagina, la llamada al elemento se hace así:

TXT
[Elemento Anchor](?classes=button#elemento-id)

estoy tratando de darle el id al elemento asi:

TXT
[Mi elemento](id=elemento-id)

No funciona, como se identifica el elemento para llamarlo desde la misma pagina?

5 years ago

@alladin, Please have the courtesy to post your question in English...

5 years ago

My question has to do with the links on the same page, the call to the element is done like this:

TXT
[Anchor element] (? Classes = button # element-id)

I am trying to give the id to the element like this:

TXT
[My element] (id = element-id)

It does not work, how is the element identified to call it from the same page?

5 years ago

@alladin, A quick Google search gave the following suggestion.

TXT
[Link taking me to Anchor 'Element'](#element)
HTML
### <a name="element"></a>Element to be linked to

or using pure Markdown

TXT
### [](?id=element) Element to be linked to
  -or-
### Element to be linked to [](?id=element) 

last edited 09/30/21 by pamtbaau
5 years ago

I assign the name to my element like this

TXT
[Generar Archivo .PFX 'fel_2'](#fel_2)

I call it that

TXT
[Generar Archivo .PFX](https://.../implement-fel#fel_2)

it does not work

note: I am doing this in grav admin

5 years ago

@alladin, Have you tried the suggestion I found using Google?

5 years ago

in google you can find the solution for html in general which is id = "fel_2" in the element, but NOT as it is done in grav

THX

5 years ago

Hello/Hola alladin
Grav works fine with html, use the anchor in the html way, in the admin module, it works, assign an id and ready. You can also make internal links using other tags like <section id="link"></section> and then you link to it from anyplace with:
<a href="http://yourwebsite.com/es/productos#link">Productos</a> if your page containing the id="link" is named, for example, productos.
Hope it helps, regards.

Spanish: Grav trabaja bien con codigo html escrito en el modulo administrativo, funciona, le asignas un id y listo. Tambien puedes hacer enlaces internos usando otras etiquetas como <section id="link"></section> y luego enlazas desde cualquier lugar con:
<a href="http://tusitio.com/es/productos#link">Productos</a> si tu página que contiene el id="link" se llama productos por ejemplo
Espero te sirva. Saludos

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 85 13 hours ago
General · by pamtbaau, 18 hours ago
1 60 17 hours ago
General · by Andy Miller, 1 day ago
0 47 1 day ago
General · by Marcel, 12 months ago
6 350 5 days ago
General · by Duc , 6 days ago
3 44 5 days ago