Best way to add internal link?

I am wondering how to add an internal link so I can jump inside a long-form page
I have tried HTML

<a href="#another-mark">anchor</a>
<h2 id="another-mark">link to anchor</h2>

But unfortunately, it failed to jump and instead, it opened a blank page.

The only thing that works is footnote.
For org syntax <<target>> does not work. I am not sure if markdown internal link works or not.

Also I have tried org ID as well. It does not work either.

2 Likes

Same as my thread. There is no way to do this other than footnote.

I requested moderator to move my thread to bugs or feature request but with no effect yet.

1 Like

@XRay Logseq has block references that work also across different pages. You can reference a block by typing (( and the content of the block to start a search. Or you can right click on any bullet point and copy the block reference for that block. Or again you can use Ctrl+C when editing a block and no word is selected.

The syntax look like these:

  • Block reference: ((5f43229a-a34c-4129-a989-408fe608c4f9))
  • Link to block: label

The links to blocks (and pages) are just Markdown links with block (or page) reference instead of a URL.


@km546 here on Discourse forum you need to use the @moderators handle.

1 Like

Thank you for the suggestions. I am well acquainted with block references, page references, and resource references in logseq. However, my use case requires jumping to specific elements within a text block, such as a particular paragraph, an embedded code snippet, or an image.

In my note system, blocks are treated with a formal structure, often accompanied by properties, tags, and followed by an org-block or org-drawer. Navigating to a reference within an org-drawer or code snippets proves challenging without establishing a footnote or a new block. Also please consider that in org syntax a code-snippet and lesser elements can only be put inside org-block. They are not logseq-block. (it may looks ok in logseq, but it looks horrible if you open it in other org editor as it is invalid org syntax).

Platforms like Obsidian permit internal linking with ^hash_tag or #anchor_alias. Similarly, org-mode employs <<target>> or [[org-id][alias]], facilitating links to locations beyond a headline/logseq-block. This feature would significantly enhance navigation within text blocks, catering to my specific requirements and long-form writing.

1 Like

When I want to edit I see:

You cannot mention group moderators.
So I used report option to let then know.

Have you consider Markdown footnotes? They work in Logseq as long as anchor and note are visible on the same page.

Thanks for the suggestion. I am using org syntax footnote. But a footnote may not be the best solution.

  1. target is not highlighted. e.g. I can use <<This is a long paragraph that the link refers to ....... and it ends here>> with org syntax and if I jump to this place I know it is a reference text
  2. The footnote syntax works in a way that the logseq block has to begin with [fn:1]. And in most case it was put in the end of the page. But in my user case, I need to refer to a few words or a few lines inside another logseq-block. So not quite solve my problem.
    Aslo I am wondering why HTML target is not working in logseq? If I understand correctly, all org/md texts are represented in HTML, aren’t they?

If you use Developer Tools (Ctrl+Shift+i) to look at the HTML you can see that the URLs generated with href=#mark starts with the wrong path. I tried to correct it manually but Logseq just ignores #mark and open the page, not jumping to the mark.

That reminders me of an issue in GitHub.

To add a Logseq internal page link simply type: [[PageName]]
and it will add a hyperlink.

Not exactly what I need. I simply need something like <<target>> in the org syntax. instead adding new page by using [[target]]. This will allow me to jump inside a long-form page

Hey,
I may have discovered how, seems there are two options:

To create an internal Logseq link to navigate to a specific section of a long page, similar to an HTML anchor tag: a href=“#anchor

For Logseq it is:
[[PageName/Header Text]]

NOTE: adding “/” jumps to actual block wiithin any logseq page

An alternative way is using: ((blockID)) jumps to position of a page.
((blockID)) allows for precise navigation to a specified ID. To link to a specific paragraph, statement, or section, not necessarily actual header.

to get link to a ‘block id’ to hyperlink to, hover /right select on bullet icon at begaining of text, then from its menu select “Copy block ref”

Im new to LogSeq though, it may also be that you are refering to something else.

My requirements are to jump to

  1. inside a long paragraph (e.g. to a phrase).
  2. inside a code snippet (e.g. function definition)
  3. a quote on another page

I do not think either block or [[page]] handles those scenarios nicely.

Somehow as I’m using Logseq I’m finding myself with a strong desire for this type of functionality or behavior as well. The following link leads to an html page which I believe gives an usable example of what I imagine.

How to Add an Anchor Link to Jump to a Specific Part of a Page - https://www.w3docs.com/snippets/html/how-to-create-an-anchor-link-to-jump-to-a-specific-part-of-a-page.html#creating-an-anchor-link-2

Notice how when you click on one of the links in the above linked page, the page auto scrolls up or down to the location of the content on the page the link refers to. As I am searching for information in my Logseq graph this would help me mentally keep the block chunk of information in context of the page it is in versus showing that block in another “view”.

In the article at the link above the writers appear to call this feature a “jumping anchor link”.

I would be ok if this feature only worked on the block level, leading me to the associated block.

1 Like

Partial workaround in Same-page links