Hey all,

What is the process for me to override the .php or .css core module files?

Comments

ayesh’s picture

For CSS, just add your new styling and they will be overriden.
For modules, make a small module that makes use of a _alter function (hook_menu_alter() , hook_form_alter or you can override it with your function ).

Never hack core.

Jenn’s picture

Nice, thanks!

duckzland’s picture

for .php I assume that you are overriding a function?

- Look for various hook_function such as hook_form_alter()

for tpl.php files :

- copy the original files to your theme folder and edit the copies + clear cache

for CSS file overriding :

- easy way is just to do css overriding (like using !important)
- hardway is invoking hook_css_alter and change the filepath in the array of the original css to your custom one (hint: look at color module and see how it is changing the custom color css from default to custom one)

--------------------------------------------------------------------------------------------------------
if you can use drupal why use others?
VicTheme.com

Jenn’s picture

Ok, I should have been more specific. I want to change CSS.

In views, the tables have a background color. I want to have the tables NOT have a background at all. How would this sort of override occur?

duckzland’s picture

usually just edit the theme css files and change the css style you want.

something like :

table {
background : none;
}

--------------------------------------------------------------------------------------------------------
if you can use drupal why use others?
VicTheme.com

Jenn’s picture

@duckzland - perfect, thank you!

pillarsdotnet’s picture

Good. — Fast. — Cheap.
(Pick any two.)