# Best way to modify topics/show.html.erb

**URL:** https://meta.discourse.org/t/best-way-to-modify-topics-show-html-erb/82478
**Category:** Development
**Created:** [March 8, 2018, 4:24am UTC](https://meta.discourse.org/t/best-way-to-modify-topics-show-html-erb/82478 "2018-03-08T04:24:41Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Magnetidog](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/magnetidog/32/116910_2.png) [@Magnetidog](https://meta.discourse.org/u/Magnetidog)
#### Post date: [March 8, 2018, 4:24am UTC](https://meta.discourse.org/t/best-way-to-modify-topics-show-html-erb/82478/1 "2018-03-08T04:24:42Z")

</div>

We need to customize the topics/show.html.erb file to add some custom functionality. I have edited the template locally and all works fine, but I would like to know if there is a standard/preferred way to edit those files without them being rewritten at each upgrade.

How do you guys normally handle it?

Thanks.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 8, 2018, 1:56pm UTC](https://meta.discourse.org/t/best-way-to-modify-topics-show-html-erb/82478/2 "2018-03-08T13:56:02Z")

</div>

You need to create a plugin. There are some tutorials available here.

---

<div class="post-metadata">

### Author: ![Magnetidog](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/magnetidog/32/116910_2.png) [@Magnetidog](https://meta.discourse.org/u/Magnetidog)
#### Post date: [March 8, 2018, 2:18pm UTC](https://meta.discourse.org/t/best-way-to-modify-topics-show-html-erb/82478/3 "2018-03-08T14:18:58Z")

</div>

Thanks Jay, I am going that route in fact - but the plugins I could find actually overwrite the template in full, which is not much different from creating a git branch for myself.

For people searching for this in the future, this might help you overwrite the html.erb file:

> [@Example Plugin: Custom Activity Summary Template](https://meta.discourse.org/t/example-plugin-custom-activity-summary-template/69016?source_topic_id=61653):
>
> Hey everyone, I have created an example plugin to override default Activity Summary (digest) template: [https://github.com/muhlisbc/discourse-custom-activity-summary-template](https://github.com/muhlisbc/discourse-custom-activity-summary-template) Screenshot: [[image] ](https://raw.githubusercontent.com/muhlisbc/discourse-custom-activity-summary-template/master/custom-digest1.jpg)[[image] ](https://raw.githubusercontent.com/muhlisbc/discourse-custom-activity-summary-template/master/custom-digest2.jpg) The main purpose of this plugin is to show how to override default .erb templates on Discourse. I hope this helpful for someone.

But I will dig deeper, maybe some automated search and replace after each update might do the trick in my case as the edits are not extensive.
