# New topic URL format

**URL:** https://meta.discourse.org/t/new-topic-url-format/225345
**Category:** Support
**Created:** [April 26, 2022, 4:47pm UTC](https://meta.discourse.org/t/new-topic-url-format/225345 "2022-04-26T16:47:19Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Cozdabuch](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cozdabuch/32/139120_2.png) [@Cozdabuch](https://meta.discourse.org/u/Cozdabuch)
#### Post date: [April 26, 2022, 4:47pm UTC](https://meta.discourse.org/t/new-topic-url-format/225345/1 "2022-04-26T16:47:20Z")

</div>

Is there a way to predict the URL that will be generated when a new topic is created so long as you have the thread title?

Reason I ask, I have a wizard setup that creates a new topic after it is complete. Based on user input into fields, the title of the thread will always follow a the specific format.

Here’s the odd deal. Rather than using DiscoTOC (we have reasons), POST 1 in the topic contains a bunch of information, but also has a topic a Table of contents. The topic will ALWAYS be 8 replies ling and each of them will use a canned response to create the “title” of each reply, (1-7). I have the wizard generating the Title with a blank hyperlink to each reply, IE.

```plaintext

[1. Meeting Agenda](/2)
[2. Meeting Files](/3)
[3. In meeting votes](/4)
[4. Meeting Minutes - [Initial Draft] Preliminary for feedback](/5)
[5. Meeting Minutes - [Final Draft] Consideration for distribution](/6)
[6. Meeting Minutes - [Distribution Copy] Vote to accept meeting minutes](/7)
[7. Reserved](/8)

```

The reason I ask is once the wizard creates the topic, it leaves my user with this list for a TOC (always the same in this category, every month). My user must copy the URL to the topic, then paste it in ahead of the`/Reply#` because the way it Discourse generates a topic’s URL has the thread number (dynamic) at the very end of the URL. With the wizard, I can generate the syntax of the entire URL, minus the topic ID.

Is there a way to generate a URL before the topic is created (so no topic ID yet) that Discourse ignores a missing topic ID but still links properly to the topic. This would be immensely useful in this case, and I suppose some other use cases to use wizards to auto generate links within a new topic being created.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 26, 2022, 6:05pm UTC](https://meta.discourse.org/t/new-topic-url-format/225345/2 "2022-04-26T18:05:40Z")

</div>

> [@Cozdabuch](#):
>
> The reason I ask is once the wizard creates the topic, it leaves my user with this list for a TOC (always the same in this category, every month).

Why doesn’t the wizard reads the response from the create topic call, which contains the newly created topic URL, and returns that to your user?

---

<div class="post-metadata">

### Author: ![Cozdabuch](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cozdabuch/32/139120_2.png) [@Cozdabuch](https://meta.discourse.org/u/Cozdabuch)
#### Post date: [April 26, 2022, 6:11pm UTC](https://meta.discourse.org/t/new-topic-url-format/225345/3 "2022-04-26T18:11:13Z")

</div>

I’m not sure how the wizard that is running before the topic is created which can capture the upcoming generated URL and insert it within the wizard’s composer..

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 26, 2022, 6:32pm UTC](https://meta.discourse.org/t/new-topic-url-format/225345/4 "2022-04-26T18:32:41Z")

</div>

> [@Cozdabuch](#):
>
> I have a wizard setup that creates a new topic after it is complete.

Maybe have the wizard create the topic first, so it can get the ID an then edit it wth the information you want?

---

<div class="post-metadata">

### Author: ![Cozdabuch](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cozdabuch/32/139120_2.png) [@Cozdabuch](https://meta.discourse.org/u/Cozdabuch)
#### Post date: [April 26, 2022, 6:38pm UTC](https://meta.discourse.org/t/new-topic-url-format/225345/5 "2022-04-26T18:38:33Z")

</div>

Yea, I’m just trying to eliminate the manual step for the user who has to maintain a records system but idiot proofed for persons not comfortable with more than very basic markdown.

The problem is the person responsible is not hired or assigned based on merit, it’s a membership election that puts them in the position and it is a specific elected position that is tasked with it. As it is now, it’s just tossing a word doc in a Dropbox folder each month. This is a little bit of a learning curve in transitioning to discourse for some of our library style and public record keeping

Hence doing my best to take the need for the user to do more than complete a wizard each month

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 26, 2022, 6:41pm UTC](https://meta.discourse.org/t/new-topic-url-format/225345/6 "2022-04-26T18:41:11Z")

</div>

Then maybe do it with the API? I dont’ fully understand the issue, but it seems like you have a chicken/egg problem. You can _usually_ use just the slug without the topic ID lke `https://meta.discourse.org/t/new-topic-url-format` , so maybe that’ll work.

---

<div class="post-metadata">

### Author: ![Cozdabuch](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cozdabuch/32/139120_2.png) [@Cozdabuch](https://meta.discourse.org/u/Cozdabuch)
#### Post date: [April 26, 2022, 9:31pm UTC](https://meta.discourse.org/t/new-topic-url-format/225345/7 "2022-04-26T21:31:13Z")

</div>

> [@pfaffman](#):
>
> but it seems like you have a chicken/egg problem

Nail on head Jay.. you hit it

I guess it boils down to is that the wizard is already responsible for creating the thread title, thus the URL can be entirely predicted except for the topic ID. So is there a way discourse will direct a user to a topic if the URL doesn’t contain the topic ID, or is there any rule via a custom plug-in that allows discourse to ignore the topic ID provided the entirety of the url matches minus the topic ID..

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 26, 2022, 9:44pm UTC](https://meta.discourse.org/t/new-topic-url-format/225345/8 "2022-04-26T21:44:52Z")

</div>

I think that if the slug is unique and it doesn’t start with a number it should work without the topic\_id.

---

<div class="post-metadata">

### Author: ![Cozdabuch](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cozdabuch/32/139120_2.png) [@Cozdabuch](https://meta.discourse.org/u/Cozdabuch)
#### Post date: [April 26, 2022, 9:56pm UTC](https://meta.discourse.org/t/new-topic-url-format/225345/9 "2022-04-26T21:56:08Z")

</div>

It does, but it’s impossible to snap to a specific reply with the last /reply#

Cause it’s domain/title/postID/reply#

Trying to figure out a way to direct to the reply without or using some generic placeholder in the postID field
