Pages is now also standalone. What does it imply (or not)? #750
-
Now that Pages is also Standalone, does it mean that it can be installed "standalone next to a Joomla website" and that it would inject content in Joomla? Or does Standalone mean that it is really standalone, meaning:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
In short, much better performance! There is a lot of overhead when you run Joomla to render a webpage:
Pages doesn't require any of the above to render a page. They are overhead. By running Pages standalone you are able to get the best performance possible. There is indeed a small bit of extra work since you have to create your own theme, use partials instead of modules and generate your own menu but that is all very easy to do. For the long version, keep reading. How a php web app worksPHP web applications like Joomla have a so-called entry point, this usually is an
Pages can now be run in 2 setups: 1. Inside JoomlaWhen Pages is run inside Joomla, Joomla's index.php is loaded, Joomla boots our Joomlatools Framework, through a system plugin and the framework is responsible to bootup Pages. 2. StandaloneWhen Pages is run standalone, you need to add your own Here is the code: Koowa::getInstance(array(
'root_path' => KOOWA_ROOT,
'vendor_path' => KOOWA_VENDOR,
'cache' => getenv('KOOWA_DEBUG') ? false : true,
));
//Bootstrap Framework
Koowa::getObject('object.bootstrapper')
->registerComponent('koowa', KOOWA_VENDOR.'/joomlatools/framework/code/libraries/joomlatools/component/koowa', 'koowa')
->registerComponent('pages', KOOWA_VENDOR.'/joomlatools/pages/code', 'koowa')
->bootstrap();
Koowa::getObject('event.publisher')->publishEvent('onAfterKoowaBootstrap');
//Dispatch Pages component
Koowa::getObject('com:pages.dispatcher.http')->dispatch(); What standalone means for PagesWhen you run Pages standalone, Pages is responsible to render the complete page. This means the following isn't available to you:
To create a site you need to create your own theme in Pages, not very hard. The result is much better performance and much more control on your end. You also don't need to bother setting up a database by default anymore. Pages doesn't require that to work, just PHP is all you need. Getting data out of JoomlaYou can still integrate Pages with Joomla, but only on a data level only. There are two options here: 1. Connecting to the Joomla databaseInstead of letting Joomla setup the database connection you would add the necessary info for this to your Pages config, much like you do in Joomla and then Pages can still use the Joomla extension and the different collection models to get data out of Joomla and render it on your site. 2. Connecting to Joomla APIAnother option is that you install Pages in the Joomla site you want to connect with and create a few pages to expose the Joomla data as a JSON webservice. This way you turn Joomla into a headless CMS. You can then use the webservice collection to connect to the endpoints in your Joomla site and get the data. Because you are using Pages on both ends, things will work seamlessly and you can make full use of all the smart caching that Pages offers. |
Beta Was this translation helpful? Give feedback.
In short, much better performance! There is a lot of overhead when you run Joomla to render a webpage:
Pages doesn't require any of the above to render a page. They are overhead. By running Pages standalone you are able to get the best performance possible.
There is indeed a small bit of extra work since you have to create your own theme, use partials instead of modules and generate your own menu but that is all very easy to do.
For the long version, keep reading.
How a php web app works
PHP web applications like Joomla have a so-calle…