The Road Goes Ever On

The Road Goes Ever On

The path we started to take with OXID 6 we consequently continue for OXID 7 and beyond.

Some years ago, we had to decide about refactor versus rewrite and opted for a kind of best of both worlds combination.

  • create a new clean Core (Internal namespace) while keeping the old Core as intact as is sensible and possible
  • use Symfony components and keep it topped it up with our own OXID Framework
  • start introducing clear interfaces
  • introduce new shop console and provide multiple commands to install/configure/controll the shop
  • use Dependency Injection Container
  • stick to the S.O.L.I.D. principles
  • clean up what's not needed anymore

We have three mechanisms to change the framework's standard behavior:

  • event subscribers and handlers
  • replace or decorate a service via Dependency Injection Container(that's why we use interfaces)
  • change the class chain via oxNew(to get into places where Events and DI Container cannot take us)
     

which offer a wide variety of possibilities to add own functionality on top of the framework.

We build the platform for you as a common base, containing functionality many users need and expect in our software. Beyond the basic platform, it's up to our partners and their customers to build with it the system that best suits their needs.
There's an ample supply of documentation and examples to help developers working with the OXID Platform. Also, we always have an open ear for your feedback.

Enough introduction, let's pick one new thing from OXID 7 to show here in some more detail. All other changes are mentioned in.

The template engine

(Citation: A template engine is software designed to combine templates with a data model to produce multiple pages that share the same look throughout the site). Short version: it's what makes your shop frontend look nice.

For long long years the OXID eShop was using the Smarty Template Engine, which was hardwired into the Shop Framework.

First preparations to extract the template engine from the shop Core into a (replaceable) component have been started around OXID 6.2 and with OXID 7 we now can use dependency injection to completely replace the template engine.
 

We deliver the OXID 7 Compilation with the modern template engine: twig <link to https://twig.symfony.com/>.

This template engine comes not built into the OXID shop core as in earlier releases but as a component (twig-component, twig-component-pe/ee). This component comes with a services.yaml which tells the Symfony DI Container which services need to be registered.

With the twig-component, we have

 

 OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateEngineInterface

 OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateRendererBridgeInterface

 

Interfaces pointing to OxidEsales\Twig\TwigEngine resp.OxidEsales\Twig\Bridge\ TwigTemplateRendererBridge.

 

So, these two interfaces are the central place where the template engine is hooked into the shop Framework. As the interfaces are clearly defined, it's dead easy to exchange the twig component with another component and have the shop use a totally different template engine. Like the good old Smarty, which we no longer actively support but have it available as a component as well. It does not come a part of the OXID eShop 7.0 compilation but if needs be the default twig component can be replaced with the smarty component.
 

The fine print: a template engine needs templates it can render, so please make sure you have a theme (as we call it) that matches the template engine.

 

And we also added a new theme based on bootstrap 5 (APEX we called it) and new demo data. Puts a happy smile on our faces to see nice cars and stuff instead of the good old Kites.

The OXID eShop 7.0 is another large step on the way to how we in OXID want to build our platform in the future. We reached a milestone, but the road goes ever on.

 

Tel. +49 761 36889 0
Mail. [email protected]