Lesson 7: Create portals using embeds

If a block reference is a window to another part of your database, an embed is a portal. Embeds allow you to edit the source directly, which comes in handy when building dashboards and pulling difference parts of your database together.

While lots is possible with embeds, we’ll limit ourselves to the basics in this lesson.

Embeds versus references

Let’s talk a bit more about the difference between block references and embed.

When referencing a block, you always reference a single block—unless you hold the Shift key before releasing, referencing the child blocks too. Embeds always show the complete context; the child blocks of the embedded block, and all of their child blocks.

As mentioned in the intro, embeds are also editable. Whereas for a block reference you have to go to the source to edit it, using a block embed you can directly access the source and change it.

Now, let’s have a look at the two types of embeds: block and page.

Block embeds

The easiest way to embed a block is by calling the embed shortcode using the trigger menu. Type /embed and hit Enter to select the first option of the trigger menu:

Block embed trigger

Now, you get the following shortcode:

Embed shortcode example

Between the ((double parentheses)), you place the address of the block you’d like to embed. Like with block references, you can start typing words here to search for a block.

Page embeds

Next to (branches of) blocks, we can also embed entire pages. This is a hidden feature in Roam, but it works flawlessly.

Again, use the /embed trigger to call the embed shortcode. Next, delete the ((double parentheses)) and replace them by [[double brackets]]:

Page embed shortcode

Inside the brackets, enter the name of the page you wish to embed. Click outside the block and the page is embedded. That’s it!

Exercise

To save yourself some time, think of pages and (branches of) blocks that you use regularly. For example, all the pages you need for your weekly review or planning session.

Next, create a new page where you embed these pages and blocks. By having all relevant information for one specific workflow in one place, you remove friction and can speed up your process.

Was this helpful?