Auto-Linkify Words

Hi this is a wonderful feature for discourse but can we limit the number of times it appears overall in a single thread topic? If we have a discussion post asking shopify vs woocommerce then the entire thread will be occupied by the hyperlinks whenever someone mentions any of these. :frowning:

3 Likes

We can definitely add a theme setting for this, PR welcome. I think a default limit of 3 auto links per word makes sense as a good initial default.

5 Likes

This feature has already been discussed couple posts above…tl;dr probably not so easy to implement.

2 Likes

Is there any way to disable linkify in a specific category? In my case I have a blog category which contains content from a wordpress installation. Hence I don’t want linkify to be active there.

Sure, that shouldn’t be hard I think. I can have a look. If there’s more people intereted in this feature, I’ll submit a PR with a new theme settings. If not, I can just post a code snippet that you can include into your theme manually. I’ll try to have a look next week.

3 Likes

Hey @sam

are there any news on this? I tried to search if there are any plans to improve the management of “lists” in theme settings but could not find anything

This is already implemented. What you see in linkify settings IS the new list management. :slight_smile:

5 Likes

Thx for the note, that clarifies it :slight_smile:
That “new” list already a great improvement!

Yet for large lists it’s still a bit of a hassle
I think an import/export feature for a simple CSV would make make a huge improvement there
Or simply pointing to a CSV URL which is pulled let’s say every 24h. or by manually by clicking a button

1 Like

You can add Option to Only insert Once time in one topic or reply?

It show every keyword in topic.

If you want to have it only once per post, you can input your linked word as a regex, i.e.

/WORD/,URL

Having it only once per topic is non-trivial, see discussion above.

6 Likes

Thank you. It’s working now.

I want to get rid of FA4, but so far linkify relies on it.
Is there any way so add an SVG icon in front of the link?

I had an autolinkified word on Discourse, but decided to remove it, because it appears every time Discourse is mentioned, leading to an overload of links in a single topic. Sometimes, unrelated links are worse than no link at all.

I have a nice use-case though for the component, e.g., to autolink ISBN numbers to a book description page on inventaire.io:

/isbn:([0-9]{13})/,https://inventaire.io/entity/isbn:$1

5 Likes

What do you mean? Linkify theme does not depend on FA icons.

I know. but I am using FA4 to add an icon to the linkify link. With FA5 I have no idea how to achieve it.

Would adding a tooltip for the link be an easy improvement?

So that we could put this as input:
keyword, link, tooltip

Maybe what you want is abbrify plugin?

Not quite sure how they would interact together, you might need to do some small customization for it to work, can help with that if needed.

4 Likes

I currently solved it by modifying the script with one extra line. It now attaches the target URL as the link title. It works really nicely.

4 Likes

I have a rather large list of entries in the linkify settings. Is there any way to export the whole thing? When hitting the export button, only the default list is exported.

Hi @jrgong

You can get it all via Data Explorer plugin query :slight_smile:

5 Likes