# Which files can you override from a plugin?

**URL:** https://meta.discourse.org/t/which-files-can-you-override-from-a-plugin/78781
**Category:** Development
**Created:** [1월 23, 2018, 5:00오후 UTC](https://meta.discourse.org/t/which-files-can-you-override-from-a-plugin/78781 "2018-01-23T17:00:14Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![eatcodetravel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eatcodetravel/32/94385_2.png) [@eatcodetravel](https://meta.discourse.org/u/eatcodetravel)
#### Post date: [1월 23, 2018, 5:00오후 UTC](https://meta.discourse.org/t/which-files-can-you-override-from-a-plugin/78781/1 "2018-01-23T17:00:14Z")

</div>

I’m creating a plugin that overrides a lot of files for a pretty much complex customization of Discourse. I was able to override most of the file except for the ones in the `components` directory. Is this expected?, is so, which files you can override and which files you can’t?

Thanks!

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [1월 23, 2018, 6:00오후 UTC](https://meta.discourse.org/t/which-files-can-you-override-from-a-plugin/78781/2 "2018-01-23T18:00:48Z")

</div>

You can modify components easily via `PluginApi` like below example

[https://github.com/discourse/discourse/blob/master/plugins/discourse-narrative-bot/assets/javascripts/initializers/new-user-narrative.js.es6#L8-L13](https://github.com/discourse/discourse/blob/master/plugins/discourse-narrative-bot/assets/javascripts/initializers/new-user-narrative.js.es6#L8-L13)

You can modify almost any file in one way or the other. [`PluginApi` methods](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/lib/plugin-api.js.es6) are better and recommended.

---

<div class="post-metadata">

### Author: ![eatcodetravel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eatcodetravel/32/94385_2.png) [@eatcodetravel](https://meta.discourse.org/u/eatcodetravel)
#### Post date: [1월 23, 2018, 6:02오후 UTC](https://meta.discourse.org/t/which-files-can-you-override-from-a-plugin/78781/3 "2018-01-23T18:02:06Z")

</div>

What about changing the `tagName`? or other things that are not in a method? is it possible too?

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [1월 23, 2018, 6:13오후 UTC](https://meta.discourse.org/t/which-files-can-you-override-from-a-plugin/78781/4 "2018-01-23T18:13:32Z")

</div>

Yes. It is simple as

```js
api.modifyClass('component:site-header', {
  tagName: 'section'
});

```

Anyway I recommending you to play around with the code before asking 😉. And explore the [guides](https://meta.discourse.org/t/beginners-guide-to-creating-discourse-plugins-part-1/30515), existing code, and plugins.

---

<div class="post-metadata">

### Author: ![eatcodetravel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eatcodetravel/32/94385_2.png) [@eatcodetravel](https://meta.discourse.org/u/eatcodetravel)
#### Post date: [1월 23, 2018, 6:14오후 UTC](https://meta.discourse.org/t/which-files-can-you-override-from-a-plugin/78781/5 "2018-01-23T18:14:52Z")

</div>

Cool, this is an alternative approach, but I want to know if there’s a restriction on the files you can override from a plugin?

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [1월 23, 2018, 6:18오후 UTC](https://meta.discourse.org/t/which-files-can-you-override-from-a-plugin/78781/6 "2018-01-23T18:18:37Z")

</div>

No. Discourse core won’t restrict any plugin abilities.

---

<div class="post-metadata">

### Author: ![eatcodetravel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eatcodetravel/32/94385_2.png) [@eatcodetravel](https://meta.discourse.org/u/eatcodetravel)
#### Post date: [1월 23, 2018, 6:19오후 UTC](https://meta.discourse.org/t/which-files-can-you-override-from-a-plugin/78781/7 "2018-01-23T18:19:56Z")

</div>

Ok cool, so overriding files from the `components` directory should work. I’ll double check then

Thanks!
