Make hashtags clickable?

Post Reply
kr428
Sr. Bludit
Posts: 31
Joined: Thu Jan 05, 2023 9:07 pm
Has thanked: 10 times
Been thanked: 2 times

Folks, when writing something like a #hashtag in a bludit page, this is merely "just" text. Is it possible to somehow render this kind of text clickable to search posts with the same tag...?
Thanks,
Kristian
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

Bludit has tags. They can be shown for example at the beginning or at the end of some text. In the text itself you can link with the URL of the tag to show all posts or pages with the tag.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
kr428
Sr. Bludit
Posts: 31
Joined: Thu Jan 05, 2023 9:07 pm
Has thanked: 10 times
Been thanked: 2 times

Edi wrote: Thu Jun 01, 2023 4:55 pm Bludit has tags. They can be shown for example at the beginning or at the end of some text. In the text itself you can link with the URL of the tag to show all posts or pages with the tag.
Ah yes, sorry, I know that, should have been more explicit here: What I'd rather like to see is Bludit rendering #hashtags (a word with a # prepended) in a post into links to a search for that hashtag on the blog automatically. But I take that's not available then...?
User avatar
multicolordev
Master Bludit
Posts: 137
Joined: Thu May 26, 2022 12:33 pm
Has thanked: 15 times
Been thanked: 91 times

next week i do it.
Image
User avatar
multicolordev
Master Bludit
Posts: 137
Joined: Thu May 26, 2022 12:33 pm
Has thanked: 15 times
Been thanked: 91 times

Still coding:)
Image
User avatar
multicolordev
Master Bludit
Posts: 137
Joined: Thu May 26, 2022 12:33 pm
Has thanked: 15 times
Been thanked: 91 times

kr428 wrote: Thu Jun 01, 2023 2:38 pm Folks, when writing something like a #hashtag in a bludit page, this is merely "just" text. Is it possible to somehow render this kind of text clickable to search posts with the same tag...?
Thanks,
Kristian
viewtopic.php?t=2642 - i do it for you :) If you like my work you can buy me coffe via paypal:)
Image
User avatar
Misteric
Ssr. Bludit
Posts: 13
Joined: Mon Aug 08, 2022 2:55 pm
Has thanked: 2 times
Been thanked: 4 times

Hi kr428 (Kristian) and others Bluditors,

There are at least two solutions:
1. You can use autocomplete (array of tags = special charater "#", make a link) in tinymce.
2. When the page is saved (new-content or edit-content) you can check with a php function (substr(), strpos() or preg_match() and replace it by a link str_replace().

Hope it helps you further!

Kind regards,

Misteric
kr428
Sr. Bludit
Posts: 31
Joined: Thu Jan 05, 2023 9:07 pm
Has thanked: 10 times
Been thanked: 2 times

multicolordev wrote: Mon Jun 12, 2023 10:39 pm viewtopic.php?t=2642 - i do it for you :) If you like my work you can buy me coffe via paypal:)
Cool, thanks very much. Been testing this, and added two notes to the github repo (as I'm unsure whether it doesn't work for me or I'm just too dumb or using the wrong setup...).😁
kr428
Sr. Bludit
Posts: 31
Joined: Thu Jan 05, 2023 9:07 pm
Has thanked: 10 times
Been thanked: 2 times

Misteric wrote: Sat Jun 17, 2023 7:49 am
There are at least two solutions:
1. You can use autocomplete (array of tags = special charater "#", make a link) in tinymce.
2. When the page is saved (new-content or edit-content) you can check with a php function (substr(), strpos() or preg_match() and replace it by a link str_replace().
Thanks very much for the input. How does that autocomplete approach work? And, more important, I assume this will add links to the text but not keywords to the actual post itself...? That's something I would have to do on my own manually, no?
Post Reply