Choose URL structure in admin/site_settings


#1

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’: Using Permalinks « WordPress Codex
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?


(Erick Guan) #2

(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?


(Erick Guan) #3

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.


#4

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???


(Erick Guan) #5

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


#6

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

But I don’t understand what you mean here:


(Erick Guan) #7

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?


#8

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:


(Jeff Atwood) #9

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.