Announcement

Collapse
No announcement yet.

Easy way to override (not extend) front-end elements

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Easy way to override (not extend) front-end elements

    This approach should allow to override front-end elements without fiddling with defines and without unexpected file replacements during upgrades

    Code:
    # put this in .htaccess of the client directory and correct path references from crm/client to <your espo>/client
    
    RewriteEngine On
    RewriteBase /crm/client
    RewriteRule ^(.*)$ - [E=ORQP_CLIENT:$1]
    RewriteCond %{ENV:ORQP_CLIENT} !override
    RewriteCond %{DOCUMENT_ROOT}/crm/client/override/%{ENV:ORQP_CLIENT} -f
    RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/crm/client/override/%{ENV:ORQP_CLIENT} [L]

    Please help me test this! Also there is room for improvement: e.g. creating a version of this rules that could accomodate any possible espo path

    Obviously this is not really recommended but I like the idea for quick testing on a development instance.

    Putting this in production means either to check for change every upgrade or start down the path of a fault-based development.
    Last edited by tothewine; 02-06-2020, 03:38 PM.
Working...
X