Choose URL structure in admin/site_settings

Continuing the discussion from Disabling English slugfier for topic’s URL in Korean language setting:

Everyone has their own preference on URL structures:

  • /topic/###
  • /discourse-is-awesome
  • /반갑습니다-여러분
  • /您好
  • or possibly transliteration

Some might prefer just English letters & numbers combination even they use their own languages.

If Discourse allows admins can choose the URL structure, it would be very useful.
Like Wordpress’ ‘Permalink Settings’: Customize permalinks – Documentation – WordPress.org
http://codex.wordpress.org/images/a/ad/permalink-settings.png

To me, /t/topic/### is just OK, but maybe there are people who want to use other structure types in my country. Also, giving options seems better, so I create this topic.

@fantasticfears would you add details or feedback?

2 Likes

(PS: This quote is broken…)

Thanks to some heavy route logic, it’s not that easy and necessary to implement custom url structure.

I would insist on /t/:topic_slug/:topic_id URL structure. There are some custom options applies to :topic_slug, which convert as:

  • default: anything to topic
  • english: Discourse 测试 to discourse(current behaviour)
  • same as title: 반갑습니다-여러분 to 반갑습니다-여러분

Does that make sense to you?

I think I misunderstood your idea…Did you want to customize all topic’s slug? I don’t like this idea since it confuses people when they saw it.

Does ‘same as title’ mean: 안녕하세요-discourse to 안녕하세요-discourse? (English + Non-English to English + Non-English)

What do you mean? Choose slug type whenever they create topics???

Yes. Only sanitized some symbol cannot be used as URL.

And ‘English’ means : cutting out non-English letters. Right? Then I love your options.

But I don’t understand what you mean here:

It’s the current behaviour. When you mix CJK characters, english letters and numbers, the Discourse strips CJK characters.

I mean did you want some mechanism to set the topic’s url like category slug you proposaled days ago?

Yes. Including the current behavior, I love your options(Default, English, Same as title) for :topic_slug.

No. I don’t want to customize all the URLs topic by topic. (I don’t like it either.)

What I want is:

  1. Admin choose URL structure for topic in site setting.
  2. Then all the new topics start to be generated with the URL logic Admin chose.

Is it clear now? :wink:

1 Like

I don’t think this request makes sense… what is really being asked for is control over whether the slug is ASCII or not, or even a custom slug.