# Placeholder Forms

**URL:** https://meta.discourse.org/t/placeholder-forms/113533
**Category:** Theme component
**Tags:** official, placeholder-forms
**Created:** [April 5, 2019, 11:18am UTC](https://meta.discourse.org/t/placeholder-forms/113533 "2019-04-05T11:18:48Z")
**Posts on this page:** 1
**Showing post:** 46

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [September 21, 2023, 11:38am UTC](https://meta.discourse.org/t/placeholder-forms/113533/46 "2023-09-21T11:38:26Z")

</div>

Hello 👋

Thanks for this component ❤ It fits perfectly what I try to achieve now. Actually my first thought was it would be super cool if it can be combine with [Reply Template](https://meta.discourse.org/t/reply-template/162373) component. But unfortunately it’s not possible as the posts above explained it. 😕

* * *

I’ve found a workaround for this to use it as a template, it works with [link to new topics](https://meta.discourse.org/t/create-a-link-to-start-a-new-topic-with-pre-filled-information/28074) and [link to new personal messages](https://meta.discourse.org/t/create-a-link-to-start-a-new-personal-message-with-pre-filled-information/35984).

Here is how made it:

1. Create a Placeholder form (to keep it simple I use the example in OP)

Your email: =NAME=-=COUNTRY=@example.com

* * *

2. Create a link to new topic:  
I set up in the link:

1. category
2. title
3. body

If you want to add empty lines, use `\` so it won’t break the link or to make it invisible you can use `&nbsp;` which will add a space in the new line. It will be a part of the template and makes empty line,

```plaintext
<a href="https://meta.discourse.org/new-topic?category==CATEGORY=&title=This is a topic created by =NAME=&body=Hello :wave:
&nbsp;
This is a test topic... Let's see the placeholder form.
\
Your email: =NAME=-=COUNTRY=@example.com
">Use template as new topic</a>

```

* * *

3. Create a topic preview

> **Selected category**
> 
> =CATEGORY=
> 
> **Topic title**
> 
> This is a topic created by =NAME=
> 
> **Topic body**
> 
> Hello 👋
> 
> This is a test topic… Let’s see the placeholder form.
> 
> Your email: =NAME=-=COUNTRY=@example.com

* * *

4. Create “Use template as new topic” button (in the example above this is a link you can make button from this)

Make a [wrap] element from this text. This makes it available to target it with CSS and style it. I add this to below.

```plaintext
<a href="https://meta.discourse.org/new-topic?category==CATEGORY=&title=This is a topic created by =NAME=&body=Hello :wave:
&nbsp;
This is a test topic... Let's see the placeholder form.
\
Your email: =NAME=-=COUNTRY=@example.com
">[wrap=template-button]Use template as new topic[/wrap]</a>

```

Styling `[wrap=template-button]`  
something like 🔽

Common / CSS

```scss
[data-wrap="template-button"] {
  background: var(--tertiary);
  color: var(--secondary);
  border-radius: var(--d-button-border-radius);
  padding: 0.5em 0.65em;
  transition: background 0.25s;
  &:focus,
  &:hover {
    background: var(--tertiary-hover);
    color: var(--secondary); 
  }
}

```

The template button will looks like this 🔽

![template-button](https://global.discourse-cdn.com/meta/original/4X/0/a/9/0a9cd15be8aa989d2c1e7b85fec8cc3aa70ad51b.gif)

* * *

Demo

[Use template as new topic](https://meta.discourse.org/new-topic?category==CATEGORY=&title=This is a topic created by =NAME=&body=Hello :wave:
 
This is a test topic... Let's see the placeholder form.
\
Your email: =NAME=-=COUNTRY=@example.com)

* * *

I hope this little tutorial will help someone who needs something similar 🙂

Edit: I’ve seted up a category chooser which add the ability to create topic in different categories.

* * *

[Check the raw version of this post…](https://meta.discourse.org/raw/113533/46)

---

_[View the full topic](https://meta.discourse.org/t/placeholder-forms/113533)._
