Modifications
GrandCMS modification system allows site owners to extend and edit the system functionality without directly editing core files. The modification system works with XML modification files formatted in a specific way. An XML modification files gives information to the system which file should be changed, which code should be changed and what changes to be done to this code.
To see a list of all the modifications applied to your system go to Extension > Modifications
You can apply modifications either by uploading a single modification file or a compressed file containing XML, PHP and SQL scripts. Both of these approaches use the Extension Installer as a way to be imported into a GrandCMS system.
Uploading a single modification file
To install a modification first you need to upload it. Go to Extension > Extension Installer and click the upload button.
GrandCMS modification files follow a strict naming rules. In order for your modification to be accepted by the installer and uploaded to the system it should have a file extension of .ocmod.xml. Here is an example yourmodifcation.ocmod.xml
After clicking upload a popup will open. Locate the modification file on your local drive and click Open
If the upload is successful, you will receive a green success message.
To apply the changes characterised by the uploaded modification file navigate to Extension > Modifications and click the refresh button at the upper right corner.
Once the modifications are applied you will receive a confirmation in the toolbar as shown below:
Uploading a compressed file containing modification files
GrandCMS allows users to install third party extension which add new feature or extend the default functionality. These extensions are also uploaded through the Extension Installer. They should also follow the naming rules for GrandCMS modifications with the exception that the file extension is your_modification.ocmod.zip
Compressed ocmod files, unlike single ocmod.xml files are not always modifying the core system files. In those cases the zip contains only dedicated extension files. If the extension which is about to be installed requires a modification of some of the core system files, besides the dedicated extension files, install.xml file containing those changes is added to the zip.
Here is what files and folders represent in ocmod.zip file:
- "upload"
- - The upload folder contains all of the core files of the extension you are about to install.
- "install.php - optional"
- - This is an optional file containing custom php scripts implementing any post-installation logic if needed.
- "install.sql - optional"
- - This is an optional file containing custom sql scripts implementing any sql script if needed. (You have to use proper prefix for your tables like the default "gc_")
- "install.xml - optional"
- - This is the file which describes the changes which your extension will make to the core system files. It also creates a virtual copy of each one of them and performs the described modifications.
Installing an extension containing a modification file
Go to Extension->Extension installer and click upload.
Select the correct modification file from your local drive and click "Open"
After you verify that the upload is successful you need to navigate to Extension > Modifications and click the refresh button.
As mentioned above after successfully applying the modification the system will notify you with green success message.