# איך להשתמש במשתנים/bbcode בפוסט?

**URL:** <https://meta.discourse.org/t/how-to-use-variables-bbcode-in-a-post/194226>\
**Category:** Development\
**Created:** [17 ביוני,‏ 2021,‏ 7:01pm UTC](https://meta.discourse.org/t/how-to-use-variables-bbcode-in-a-post/194226 "2021-06-17T19:01:56Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Nacho\_Caballero](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nacho_caballero/32/130189_2.png) [@Nacho\_Caballero](https://meta.discourse.org/u/Nacho_Caballero)\
**Post date:** [17 ביוני,‏ 2021,‏ 7:01pm UTC](https://meta.discourse.org/t/how-to-use-variables-bbcode-in-a-post/194226/1 "2021-06-17T19:01:56Z")

</div>

I’m trying to figure out what would be the best way to write something like this on a post:

```plaintext
[Click here to save your spot](https://mysite.com/$CURRENT_USERNAME)

```

Where `$CURRENT_USERNAME` would turn into a different value depending on which user was logged on.

I think I can get the current username using the plugin api inside a theme component, but I’m not sure about the best way to actually insert the link.

I guess one option would be to write a plugin that adds a new bbcode command, like [discourse-details](https://github.com/discourse/discourse/tree/master/plugins/discourse-details) or [discourse-spoiler-alert](https://github.com/discourse/discourse-spoiler-alert). Something like this:

```plaintext
[dynamic-url description="Click here to save your spot" pattern="https://mysite.com/$CURRENT_USERNAME"][/dynamic-url]

```

Or even more generally:

```plaintext
[dynamic-tag tagName="iframe" src="https://mysite.com/$CURRENT_USERNAME"][/dynamic-tag]

```

But I’m wondering if there is a simpler alternative.

---

_[View the full topic](https://meta.discourse.org/t/how-to-use-variables-bbcode-in-a-post/194226)._
