English (United Kingdom)
Need to customize the layout of a specific page of the Plugin? Thanks to the Overrides function, you will be able to create a copy of the layout file of a specific page to customize it. This will prevent future updates to overwrite your modifications.
1.0

What is an override? It's a technique to create a clone-copy of a specific layout file that generates the graphical output of a specific page/content of the Plugin, or one of its Widgets. Imagine that you would like to remove a link from a page, or to add a text or a button. If you were to modify the original (core) file of the Plugin, then at its next update all your modifications would go lost. Instead, you can create an override for that specific layout file so that it will be preserved during the installation of the future updates.
Just to be clear, this is a feature of the plugin Vik Rent Car and all its widgets, because WordPress does not support overrides by default. It's a function that our programmers have built to meet the needs of our clients.

In order to create an override-file for a specific page of the Plugin, either front-end or back-end, or a new layout file for a Widget, you need an FTP client software to create a couple of folders, and to download and upload some PHP files.

This is a list of the required steps to create an override file:

  1. Locate your WordPress Upload Directory via FTP. The directory usually used as the upload dir is in /wp-content/uploads/.
  2. Make sure to have uploaded at least one photo for your cars through the admin pages of Vik Rent Car.
  3. Locate the Vik Rent Car Upload Directory via FTP. It's always a sub-directory of the WordPress Upload Directory. Usually /wp-content/uploads/vikrentcar/.
  4. Locate the Vik Rent CarOverrides Directory via FTP, and keep this path in mind, as this is called the Overrides Base Path. Usually /wp-content/uploads/vikrentcar/overrides/.
  5. Create a folder inside the Overrides Base Path called "site" that will store all the override files for the pages of the front-end site. Depending on your Upload Directory, the path should be similar to /wp-content/uploads/vikrentcar/overrides/site/.
  6. Find the name of the page (View) of the front-end in Vik Rent Car that you would like to customize. For example, the list of cars is generated through the View (layout file) called "carslist".
  7. Copy the original layout file of the View (default.php) onto the Overrides Base Path directory "site". For creating a copy of the layout file of the View called "carslist", you should copy the following file:
    /wp-content/plugins/vikrentcar/site/views/carslist/tmpl/default.php

    onto the following directory, given the examples above with our Overrides Base Path:
    /wp-content/uploads/vikrentcar/overrides/site/carslist/default.php

    The view "carslist" was missing in "/site" so this had to be created via FTP. Now the path above will be used by the Vik Rent Car plugin to load the layout file for the page Cars List.

  8. Modify the HTML/PHP/JS/CSS code of the layout file to meet your needs. This override file will never be touched by future updates, and it's a secure layout file because it can only be executed by Vik Rent Car behind the execution of the WordPress framework.

Imagine that you would like to create an override file for a specific Widget, like the Horizontal Search Form or the Currency Converter: you can create an override layout file also for the Widgets! In this case, next to the folder "site" in the Overrides Base Path directory, create a folder via FTP called "modules", that contains the name of the Widget and its layout file inside it. Then, by editing the parameters of the Widget from the wp-admin section, you will be able to choose the desired layout file from the overrides.

For example, to create an override file of the Widget "Search Form", you should copy the following file:
/wp-content/plugins/vikrentcar/modules/mod_vikrentcar_search/tmpl/default.php

onto the following path, by creating the missing directories after your Overrides Base Path of Vik Rent Car:
/wp-content/uploads/vikrentcar/overrides/modules/mod_vikrentcar_search/default.php

Last Update: 2019-11-29
Helpful?
48% of people found this helpful.
This site uses cookies. By continuing to browse you accept their use. Further information