Feature Request: Support `metadata` for Entry-Hyperlinks


As I moved articles from Zendesk to Contentful, I needed to create hyperlinks to and from entries.
Zendesk supports the ability to select a specific header within an entry to have the scroll position appear at that header’s location when accessing that entry’s page. (window.location.hash)

However, Contentful doesn’t allow you to do that when you add a hyperlink to an Entry.

While it’s difficult to directly specify content such as headings, it would be easier to solve this problem if the metadata feature was supported in JSON.


Suppose you set metadata as shown below when setting a hyperlink to an Entry.

  "hash": "how-to-create-audience"

In Next.js or elsewhere that does the rendering, you can use metadata to configure the feature as shown below.

[RichText.INLINES.ENTRY_HYPERLINK]: (node, children) => {
  const id = getNodeId(node);

  const matchedItem = entry.get(id);
  if (!matchedItem) { return null; }

  // render the entries as needed
  if (isEntry(matchedItem)) {
    const hash = node.data.metadata ? `#${node.data.metadata.hash}` : '';
    return (
      <Link href={`${matchedItem.url}${hash}`}>

  return null;

Then, the rendered result will be:

<a href="/some-amazing-url#how-to-create-audience">
// some children...

What about creating a Content Model and using Inline Entry?

It could be possible.
but creating an Inline Entry each time would be quite tedious, and I suspect that creating a lot of entries would affect the creation limits of entries.