There are two ways to reference (have a link to) a page/block by other than its name/id.
Method 1: Use the form []()
to link to the page/block.
[some text](page name)
[some text](block id)
This way, the reference will be displayed as what you write inside []
. It’s a non-permanent alias. (Equivalent to Obsidian’s [[page name|some text]]
.)
Method 2: Set the alias::
property.
This way, you will be able to reference by any custom label a page having that label as the value of alias::
. It’s a permanent alias. (Equivalent to Obsidian’s aliases: some text
between a pair of ---
at the beginning of a page.)
I wish alias::
were available for blocks too, so that we could use it to create a pseudo readable id for a block, to substitute for the random alpha-numeric id; apparently we can’t. Apparently alias::
is only for page properties: the word/phrase after alias::
is usable for linking and searching only if it’s set as the page property (in the first block of a page).
“Reference the entire block”… Any link to a block is a reference to it and its children. For example, let’s say your Obsidian note has a heading “Food” and sub-headings “Fruits” and “Vegetables”, along with all their paragraphs: in order to have them all as one unit for reference, you convert them into a tree of blocks, with “Food” as the parent, the sub-headings as children blocks, and the paragraphs as those children blocks’ children blocks –
- Food
- Fruits
- blah blah
- blah blah
- Vegetables
- blah blah
- blah blah
; then, to reference the entire tree, you create a link to the tree’s top, which is the parent block, “Food” – create a link to that block’s id. To obtain the id, you can first type ((Food))
, it will show you a dropdown list of blocks having the word “Food” (any ones in the graph, auto-searching all pages), for you to select the specific block, to get its id. (So you can create a reference to a block easily enough despite its unmemorisable random id, as long as you know what text the block has, as a search term, which can well be the heading text itself.) Otherwise manually you can right-click on the target block’s bullet and select “Copy block ref”. (You can use this bullet to also drag the block around, to even take it out of the page and into another page displayed in the right sidebar. Drag-and-dropping is the way to move a block between pages without losing the block’s id: copy-and-pasting a block creates a different instance of it, for a different id.)
About key:: value
and #parent/child
…
It’s about how Logseq handles keywords as different identifiers of different pages/blocks. In Logseq, SomeWord
(any string of text as a keyword) works as #SomeWord
and [[SomeWord]]
and SomeKey:: SomeWord
, so that you can use the same word as a tag or a name or a property value:
#SomeWord
– a tag
[[SomeWord]]
– a name
SomeKey:: SomeWord
– a property (by a key and a value)
In all three cases, SomeWord
represents a link target: clicking on it takes you to the page named SomeWord
. To be named SomeWord
means to have title:: SomeWord
or alias:: SomeWord
. The title::
property defines the page’s non-alias main name, every page has this property, and it’s normally hidden, as the value is identical to the page’s title section (the larger text at the page’s top that you can click and modify). If a page’s title section says “Page 2”, it has title:: Page 2
even if this is not shown as the page property.
So, #SomeWord
and [[SomeWord]]
are equivalent as a link (linking to the page named SomeWord
). One difference is when using queries. A query, {{query ...}}
, is a custom search that can be inserted into a block to display a particular search result, and you can create a query that searches for a block having a particular tag, #...
. A tag doesn’t have to be a page name, it can be a theme of the block, so it can help in searching for one particular block having a unique theme or a set of blocks sharing a general theme. A heading block like “The healthiest foods” could have a tag like #Food/Healthy
, and this will be listed in the Linked References sections of the page named Food
and of the page named Healthy
. As far as making a block listed in that bottom section of particular pages, again #SomeWord
and [[SomeWord]]
are equivalent: a block having [[SomeWord]]
in its text will be listed in the page SomeWord
along with any block having #SomeWord
.
With tags, the difference between the nesting form #Food/Healthy
and the non-nesting form like #Food-Healthy
is that Logseq sees the former as multiple keywords (separated by /
) and the latter as one keyword. Writing #Food/Healthy
means that there may be two pages respectively by those two keywords as names, Food
and Healthy
, and Healthy
will be listed in the page Food
’s Hierarchy section. This Hierarchy section is an auto-updating list of related keywords. “Related” here means being above or below /
, as parent or child. With #Food/Healthy
, Healthy
is below Food
, as a child of Food
, as a sub-topic. You can have different hierarchies of the same keywords: along with #Food/Healthy
in one block, you can in other blocks use its inverse, #Healthy/Food
, so that Food
will be listed in the page Healthy
, just as #Food/Healthy
makes Healthy
listed in the page Food
. (This flexibility is good, as we don’t always know which topics should go under which other topic.)
So, the form #parent/child
is a way to categorise tags. Then, if a category of tags is rather administrative (such as “Status” for Draft
and Finalised
– something so meta that you don’t want it as a clickable link to a whole page by that word), you can use the property form, Status:: ...
instead of #Status/...
.