# 이 홈 수정 코드를 도와줄 수 있는 분 있나요?

**URL:** https://meta.discourse.org/t/can-anyone-help-me-with-this-home-modification-code/249184
**Category:** Support
**Created:** [12월 16, 2022, 8:13오후 UTC](https://meta.discourse.org/t/can-anyone-help-me-with-this-home-modification-code/249184 "2022-12-16T20:13:05Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![xebiyen](https://avatars.discourse-cdn.com/v4/letter/x/858c86/32.png) [@xebiyen](https://meta.discourse.org/u/xebiyen)
#### Post date: [12월 16, 2022, 8:13오후 UTC](https://meta.discourse.org/t/can-anyone-help-me-with-this-home-modification-code/249184/1 "2022-12-16T20:13:05Z")

</div>

meta에서 코드를 발견하여 다른 포럼의 도움으로 여기에서 수정했습니다. 하지만 더 이상 편집할 수 없는 지점에 도달했습니다. 지식이 부족해서입니다. views 열을 제거하고 answers 열만 남기고 싶습니다. 또한 activity 열 부분에서, 해당 주제에 마지막으로 댓글을 남긴 사람의 이름과 댓글 작성 시점을 중앙 정렬하고 싶은데, 어떻게 해야 할지 모르겠습니다.

 ![image](https://global.discourse-cdn.com/meta/original/4X/1/6/5/1651a594b9d956a32dea5dd4f9b95730a0acdfc4.png)

```plaintext
<script type='text/x-handlebars' data-template-name='list/topic-list-item.raw'>

{{~raw-plugin-outlet name="topic-list-before-columns"}}

{{#if bulkSelectEnabled}}
  <td class="bulk-select">
    <input type="checkbox" class="bulk-select">
  </td>
{{/if}}

<td class='author topic-list-data'>
  <a href="{{topic.creator.path}}" data-user-card="{{topic.creator.username}}">
    {{#if (theme-setting 'show_author_username')}}
      {{topic.creator.username}}
      {{else}}
      {{avatar topic.creator imageSize="45"}}
    {{/if}} 
  </a>
</td>

<td class='main-link clearfix topic-list-data' colspan="1" role="rowheader">
  {{~raw-plugin-outlet name="topic-list-before-link"}}
  <span class='link-top-line'>
    {{~raw-plugin-outlet name="topic-list-before-status"}}
    {{~raw "topic-status" topic=topic}}
    {{~topic-link topic class="raw-link raw-topic-link"}}
    {{~#if topic.featured_link}}
	  {{~topic-featured-link topic}}
    {{~/if}}
    {{~raw-plugin-outlet name="topic-list-after-title"}}
    {{~raw "list/unread-indicator" includeUnreadIndicator=includeUnreadIndicator 
                                   topicId=topic.id 
                                   unreadClass=unreadClass~}}
    {{~#if showTopicPostBadges}}
      {{~raw "topic-post-badges" unread=topic.unread newPosts=topic.displayNewPosts unseen=topic.unseen url=topic.lastUnreadUrl newDotText=newDotText}}
    {{~/if}}
  </span>
  <div class="link-bottom-line">
    {{#unless hideCategory}}
      {{#unless topic.isPinnedUncategorized}}
        {{category-link topic.category}}
      {{/unless}}
    {{/unless}}
    
	{{discourse-tags topic mode="list" tagsForUser=tagsForUser}}
    {{raw "list/action-list" topic=topic postNumbers=topic.liked_post_numbers className="likes" icon="heart"}}
  </div>
  {{#if expandPinned}}
    {{raw "list/topic-excerpt" topic=topic}}
  {{/if}}
</td>

{{raw "list/posts-count-column" topic=topic}}

{{#if showLikes}}
  <td class="num likes topic-list-data">
    {{#if hasLikes}}
      <a href='{{topic.summaryUrl}}'>
        {{number topic.like_count}} {{d-icon "heart"}}</td>
  </a>
{{/if}}
{{/if}}

<td class="num views {{topic.viewsHeat}} topic-list-data">{{number topic.views numberKey="views_long"}}</td>

<td class="last-post">

<div class='poster-info'>
<span class='editor'><a href="/users/{{topic.last_poster_username}}" data-auto-route="true" data-user-card="{{topic.last_poster_username}}">{{topic.last_poster_username}}</a></span>
<br />
<a href="{{topic.lastPostUrl}}">
{{format-date topic.bumpedAt format="tiny"}}
</a>
</div>
</td>
</script>

<script type='text/x-handlebars' data-template-name='topic-list-header.raw'>
{{~raw-plugin-outlet name="topic-list-header-before"~}}
{{#if bulkSelectEnabled}}
  <th class="bulk-select topic-list-data">
    {{#if canBulkSelect}}
      {{raw "flat-button" class="bulk-select" icon="list" title="topics.bulk.toggle"}}
    {{/if}}
  </th>
{{/if}}
{{raw "topic-list-header-column" order='default' name=listTitle bulkSelectEnabled=bulkSelectEnabled showBulkToggle=toggleInTitle canBulkSelect=canBulkSelect}}
{{raw "topic-list-header-column" sortable=sortable number='true' order='posts' name='replies'}}
{{#if showLikes}}
  {{raw "topic-list-header-column" sortable=sortable number='true' order='likes' name='likes'}}
{{/if}}
{{#if showOpLikes}}
  {{raw "topic-list-header-column" sortable=sortable number='true' order='op_likes' name='likes'}}
{{/if}}
{{raw "topic-list-header-column" sortable=sortable number='true' order='views' name='views'}}
{{raw "topic-list-header-column" sortable=sortable number='true' order='activity' name='activity'}}
</script>

<script type='text/x-handlebars' data-template-name='topic-list-header.raw'>
{{#if bulkSelectEnabled}}
  <th class="bulk-select topic-list-data">
    {{#if canBulkSelect}}
      {{raw "flat-button" class="bulk-select" icon="list" title="topics.bulk.toggle"}}
    {{/if}}
  </th>
{{/if}}
{{raw "topic-list-header-column" number='true'}}
{{raw "topic-list-header-column" order='default' name=listTitle bulkSelectEnabled=bulkSelectEnabled showBulkToggle=toggleInTitle canBulkSelect=canBulkSelect}}
{{raw "topic-list-header-column" sortable=sortable number='true' order='posts' name='replies'}}
{{#if showLikes}}
  {{raw "topic-list-header-column" sortable=sortable number='true' order='likes' name='likes'}}
{{/if}}
{{#if showOpLikes}}
  {{raw "topic-list-header-column" sortable=sortable number='true' order='op_likes' name='likes'}}
{{/if}}
{{raw "topic-list-header-column" sortable=sortable number='true' order='views' name='views'}}
{{raw "topic-list-header-column" sortable=sortable number='true' order='activity' name='activity'}}
{{~raw-plugin-outlet name="topic-list-header-after"~}}
</script>

<script type="script/discourse-plugin">
(function(){
var TopicListItemView = require('discourse/components/topic-list-item').default;
TopicListItemView.reopen({
    showCategory: function(){
        return !this.get('controller.hideCategory') &&
                this.get('topic.creator') &&
                this.get('topic.category.name') !== 'uncategorized';
    }.property()
});
   
})();
</script>

```

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [12월 16, 2022, 9:17오후 UTC](https://meta.discourse.org/t/can-anyone-help-me-with-this-home-modification-code/249184/2 "2022-12-16T21:17:30Z")

</div>

템플릿을 오버라이드하여 컬럼을 제거하려면 다음을 좋은 출발점으로 삼을 수 있습니다:

[https://meta.discourse.org/t/beginners-guide-to-developing-discourse-themes/93648#overriding-discourse-templates-23](https://meta.discourse.org/t/beginners-guide-to-developing-discourse-themes/93648#overriding-discourse-templates-23)

이 글은 컬럼을 제거하기 위해 템플릿을 오버라이드하는 방법을 설명합니다.

> **직접적인 해결책**
>
> 1. 관리자 패널에서 사용자 지정 → 테마 → 내 테마 → CSS/HTML 편집으로 이동하세요.
> 
> 2. Head 탭에서 다음 코드를 붙여넣으세요:
> 
> 3. `<script>` 태그 사이에 원래 템플릿의 내용을 붙여넣으세요:  
> [https://raw.githubusercontent.com/discourse/discourse/main/app/assets/javascripts/discourse/app/templates/list/topic-list-item.hbr](https://raw.githubusercontent.com/discourse/discourse/main/app/assets/javascripts/discourse/app/templates/list/topic-list-item.hbr)
> 
> 4. 다음 부분을 제거하세요:
> 
> 5. CSS 탭으로 이동하여 다음 코드를 삽입하세요:
> 
> 6. 변경 사항을 저장하는 것을 잊지 마세요.
> 
> 결과:
> 
> ![image](https://global.discourse-cdn.com/meta/original/4X/0/a/b/0ab2248cd0a68d988d270110f1a6a7be9f85b382.png)

* * *

CSS만 사용하는 해결책 (훨씬 짧음):

```css
.topic-list {
    .views {
        display: none;
    }
}

```

템플릿 오버라이드는 Discourse 템플릿 코드가 버전마다 변경될 수 있으므로 그에 따라 오버라이드를 수정해야 하기 때문에 더 많은 "관리"가 필요하다는 점도 덧붙입니다.

CSS 해결책은 더 유연합니다.
