How to override course/modeedit.php file in custom theme

How to override course/modeedit.php file in custom theme

by MSHP MATHURA -
Number of replies: 2
Hi ,
Would you please tell us that how to override course/modedit.php file in custom theme.
I want to change somthing.

Thanks.
Average of ratings: -
In reply to MSHP MATHURA

Re: How to override course/modeedit.php file in custom theme

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
If you're looking to change the styling of the page, then you can target it using the id tag of the 'body' element of the page (that will allow you to make styling changes to only that page).

If the "something" you want to change is not related to the CSS of the page, then you probably can't change it using a theme (and depending on what that "something" is, there's a good chance you cannot change it without making changes directly to the core code).

In reply to MSHP MATHURA

Re: How to override course/modeedit.php file in custom theme

by Mark Sharp -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
If you're looking to add some new settings to the activity settings, you can add some functions in your theme's (or any plugin's) lib.php file to handle that, without changing core code (theme_yourtheme_coursemodule_standard_elements, theme_yourtheme_coursemodule_definition_after_data, theme_yourtheme_coursemodule_edit_post_actions). These functions handle how your data is displayed as a form, and how to handle the data if it is updated.

I use it just to display some extra external data about assignments. You can see my use of it here: https://github.com/ltu-solent/moodle-local_solsits/blob/ca897be9687cd05ea72ada28bc64b38cee072fe5/lib.php#L36

If you want to manipulate already existing fields and don't want to change core code, you could use Javascript, perhaps. Though obviously that won't work if you're using the mobile app.