aborruso
(Andrea Borruso)
December 1, 2017, 2:39pm
1
Hi,
I’m trying to use a simple html <a>
to open a URL like
http://mysite.com/new-topic?title=topic%20title&body=topic%20body&category=actions
It works for title and body, but I’m not able to set the category via URL. Is it possible?
And is it possible to set a tag?
I need to do it via a simple click.
Thank you
4 Likes
It should work ok as per here:
Discourse now supports composing a new (pre-filled) topic via URL! To compose a new pre-filled topic, modify URL params like this:
https://discourse.example.com/new-topic?title=topic%20title&body=topic%20body&category=category/subcategory&tags=email,planned
This will open composer window pre filled with topic title, body, category and tags.
Breaking down the link / URL to show the available options, we have:
the base URL / link: https://discourse.example.com/new-topic
the ? URL operator to…
https://url.com/new-topic?title=topic%20title&body=topic%20body&category=category/subcategory&tags=email,planned
For example:
https://meta.discourse.org/new-topic?title=topic%20title&body=topic%20body&category=support&tags=email,planned
10 Likes
If it’s not working @techAPJ can follow up; it should be working!
1 Like
aborruso
(Andrea Borruso)
December 2, 2017, 8:29am
4
It works great!!
It was my error: I was writing the category slug
and not the category name
.
Thank you
6 Likes
jomaxro
(Joshua Rosenfeld)
December 5, 2017, 2:56am
5
This has come up before @techAPJ . Bit me personally back in the day. Any reason why we only support name
and not slug
?
1 Like
techAPJ
(Arpit Jalan)
December 6, 2017, 8:49am
6
Not sure actually. Might be because slug sounds technical.
It can either support name or slug. Should we deprecate name in favour of slug?
They are different things. Name does not equal slug.
Name would be
Games and Fun
slug would be
games-and-fun
1 Like
techAPJ
(Arpit Jalan)
December 6, 2017, 11:26am
8
I understand. By “slug sounds technical” what I meant was not everybody would understand the difference between name and slug. That’s why I added support for name instead of slug.
Moreover, name could be Quick: Unreliable Information Causes Knowledge
and slug could be quick
. So it’s not as easy at it sounds to deprecate name in favor of slug…
2 Likes
I do think site owners who are familiar with how the web works should understand the word “slug”, so it is not that technical IMO.
1 Like
This topic was automatically closed after 2380 days. New replies are no longer allowed.