Page Builder - Override your content in your template

You shall know about the template override in Joomla! that allows you to change the html code that is rendered in the page. This technique is based on files that you shall put in your template and that will be used instead of the ones from the extension. Since the version 2.12.0 of Page Builder CK, you can now use an override technique to control the output from your template !

How to create an override - Example with the audio tag

First you shall know that the content of your page is rendered in your page thanks to the pagebuilderck plugins. The default output is generated from the plugin. Here we will make a simple example with the audio player.

Go in the folder

plugins/pagebuilderck/audio

1. Copy the file audio.php and paste it into your template :

templates/YOURTEMPLATE/html/pagebuilderck/audio.php

 

2. Rename the PHP class by adding the Override suffix. Example :

Rename plgPagebuilderckAudio into plgPagebuilderckAudioOverride

 

WARNING : you must rename the class, or you may have an error in your website because 2 files with the same class are loaded.

 

3. Edit the output in the file : you can now edit the code that is rendered for the audio tag, and this will apply to all audio players in your website. The function that will render your code is onPagebuilderckRenderItem[Addon], for example with the audio addon : onPagebuilderckRenderItemAudio. This is where you can play with the code that you want to show in your page.

 

Download Page Builder CK