Can we change the title of the topic without changing the slug, at least for admin?
The old slug URL would still redirect to the article, is that your concern with the slug changing?
No, I know that it will redirect, but I prefer not having redirection and just change the title, like in wordpress.
That probably needs to be logged in the Contribute > Feature category then as I’m pretty sure that it isn’t something Discourse currently allows.
No this can not be done, slug is coupled to title.
@sam does the old url then redirect to the new one? Concerned that if we allow high trust users to edit topics, we may end up sending visitors from old links to broken pages.
Is the slug appears in the database? If so, there should be no problem allowing the admin at least to change the title. If the slug isn’t in the database, it is a problem.
The old URL does redirect, it’s ID based and it checks if the slug is the same as the one in the databse or after normalization of the title. I blieve.
The slug is cached, but but the source of truth is always the topic title. Quite a few internals need to be changed to allow overriding, not on any roadmap.
여전히 그런가요?
제 사용 사례는 다음과 같습니다. Ghost 블로그에 게시물을 올리면 Discourse에서 주제가 생성됩니다. Ghost 창립자의 aforementioned(이전에 언급된) 제안을 따라 슬러그 길이를 줄였는데, 가장 최근 게시물에 이를 적용했습니다. Discourse는 게시물 슬러그가 아니라 게시물 제목에서 슬러그를 생성합니다. 이 부분은 잘 작동하지만, 홈페이지(그리고 각 개별 게시물 상단)에 각 게시물의 댓글 수를 표시하는 discourse-get-comment-count 스크립트도 사용 중입니다. 문제는 이 스크립트가 Discourse(제가 용어를 올바르게 이해했다면)에서 게시물 제목이 아니라 슬러그를 쿼리하기 때문에 실제 댓글 수를 찾지 못한다는 것입니다. (사이트 상단의 게시물을 보면 댓글 수가 스피너에 고정되어 있는 것을 확인할 수 있습니다.)
슬러그를 커스터마이징하지 않는 것 외에 이 문제를 해결할 방법이 있을까요?
이 구현 방식이 좀 ![]()
여기서 topic_id를 사용하지 않는 이유는 무엇인가요: discourse-get-comment-count/update-comments.js at master · vikaspotluri123/discourse-get-comment-count · GitHub
만약 그렇게 한다면 슬러그는 전혀 중요하지 않게 됩니다.
전부 이해한다고는 할 수 없지만, 당신의 제안을 전달했을 때 돌아온 답변은 다음과 같습니다:
Ghost 포스트의 id, slug, 또는 url을 기반으로 topic_id를 어떻게 가져올 수 있을까요?
제 이해로는 포스트 id를 사용하여
external_id속성을 통해 토픽을 연결할 수 있을 것 같지만, external_id 사용은 API로 제한되어 있고, 토픽은 임베드 기능을 통해 생성되므로 (external_id를 지원하지 않는 것으로 보입니다) 문제가 있는 것 같습니다.
참고로, 이전 댓글에서 언급한 것과 달리, 몇 시간 전에 해당 Ghost 포스트의 slug를 기본값으로 되돌렸습니다. 따라서 댓글 수가 스피너에 멈춰 있다는 설명은 더 이상 적용되지 않습니다.
당신이 우리의 임베딩을 사용하고 있다면, Discourse는 임베딩 URL과 주제(topic) 사이의 매핑을 유지합니다.
따라서 다음을 사용할 수 있습니다:
이를 통해 댓글 수 목록을 가져올 수 있습니다.
댓글 수를 가져오는 작업은 해당 엔드포인트에 ghost URL을 전달하여 호출하면 됩니다. 여러 URL을 전달할 수 있는 “batch” 엔드포인트를 만들 가능성에 열려 있습니다. 이에 대한 PR을 환영합니다.