<p>Is it possible to change core elements index pages -like entry index page- by plugin in PHP way, like extending their twig, using events, hooks and not manipulating DOM with Javascript?</p>

<p>Currently only way i know is to register a JS file for those pages and add HTML via Javascript.</p>

CC BY-SA 4.0
2019-10-25T21:06:16.153Z
I'm voting to close this question as off-topic because it doesn't seem to be craft-related
kmgdev
CC BY-SA 4.0
2019-10-26T11:07:14.623Z
@kmgdev why do you think that entries, twig template, template hook or events is not related to craft cms?
user9975
CC BY-SA 4.0
2019-10-28T12:58:11.163Z
I don't find this off-topic, it most definitely is Craft-related. To the question – I don't think you can actually change the core code. It might be that you'd be better off copying the template from core and make the changes you want, and make a CP page for it.
KSP
CC BY-SA 4.0
2019-10-28T13:13:04.480Z
@KSP thanks, are you suggesting to redirect pages like entries/{sectionname} which is a element index page to my page via rules or controller map by custom plugins? it seems it is a solution but a little bit hacky to me. could you possibly post your answer plz?
user9975
CC BY-SA 4.0
2019-10-28T13:55:25.263Z
I haven't really tested any of it myself, so I'm just guessing a bit, so I don't feel it really fit for an answer. As far as I know, there is no way to reach into other templates directly, that's why I thought it's better to extend it, or simply copy it and make the changes you want. It seems that the actual index is built via a JS call in /vendor/craftcms/cms/src/templates/_layouts/elementindex.html and rendered in /vendor/craftcms/cms/src/templates/_elements/elementindex.html
KSP
CC BY-SA 4.0
2019-10-28T13:58:00.273Z
You could say it's a bit hacky, but at least you're keeping your own code separate from the core code, and not directly reliant on it. If you don't need all kinds of filter/sorting capabilites, etc., you could also roll your own, and utilise the Craft CP look and feel by reusing their CSS and HTML structure. The plugin CP Style Guide could be a starting point (although it's only exactly that – a style guide).
KSP
<craft3><plugins><element>
change core element index pages
# change core element index pages

(Asked by: username_0 on 2019-10-25)

Is it possible to change core elements index pages -like entry index page- by plugin in PHP way, like extending their twig, using events, hooks and not manipulating DOM with Javascript?

Currently only way i know is to register a JS file for those pages and add HTML via Javascript.

**Tags:** craft3, plugins, element

> **Comments:**
> **username_1**: I'm voting to close this question as off-topic because it doesn't seem to be craft-related  
> **username_0**: @username_1 why do you think that entries, twig template, template hook or events is not related to craft cms?  
> **username_2**: I don't find this off-topic, it most definitely is Craft-related. To the question – I don't think you can actually change the core code. It might be that you'd be better off copying the template from core and make the changes you want, and make a CP page for it.  
> **username_0**: @username_2 thanks, are you suggesting to redirect pages like entries/{sectionname} which is a element index page to my page via rules or controller map by custom plugins? it seems it is a solution but a little bit hacky to me. could you possibly post your answer plz?  
> **username_2**: I haven't really tested any of it myself, so I'm just guessing a bit, so I don't feel it really fit for an answer. As far as I know, there is no way to reach into other templates directly, that's why I thought it's better to extend it, or simply copy it and make the changes you want. It seems that the actual index is built via a JS call in /vendor/craftcms/cms/src/templates/_layouts/elementindex.html and rendered in /vendor/craftcms/cms/src/templates/_elements/elementindex.html  
> **username_2**: You could say it's a bit hacky, but at least you're keeping your own code separate from the core code, and not directly reliant on it. If you don't need all kinds of filter/sorting capabilites, etc., you could also roll your own, and utilise the Craft CP look and feel by reusing their CSS and HTML structure. The plugin CP Style Guide could be a starting point (although it's only exactly that – a style guide).  

---

## 0 answers

