statamic / wikilinks

Autolinks content wrapped in [braces], just like a wiki.
https://statamic.com
MIT License
1 stars 3 forks source link

Scope to collection type? #1

Closed andyra closed 3 months ago

andyra commented 5 years ago

First: this addon is already so great. I love the fuzzy matching if you misspell something. Well done!

I'm curious if there's a way to scope the link to a specific collection. The problem I'm running into is that I oftentimes have the same title (and slug) in two different collections. For instance, if I have two collections called albums and us_states, I might run into the following problem:

The Bruce Springsteen album [Nebraska] is melancholy and pure.

which creates a link to the us_state instead of the album.

Adding the scope to either the content or the template would solve this problem, something like:

# Content
The Bruce Springsteen album [Nebraska | collection:albums] is melancholy and pure.

# Template
<div>{{ content_field | markdown | wikilinks:albums:title }}</div>

Does that sound like an interesting / useful / possible addition?