2021-02-07, 04:59:02
Hi,
Thanks for stepping in,
sorry I forgot to mention that I am building with the 3.3.16
What I could find is returnPageContent('slug');
This works fine for 1 language
The i18n plugin has return_i18n_component('slug') but it returns the output unprocessed
(includes the php tags, quotes and semicolon)
=======================================================
Yes the best working solution seems to make use of PHP output buffering
It works also nice with multi-language and it even allows
chaining api calls:
Working example on a template file:
On the front:
Works flawlessly ...
===========================================================
It is said that you have to be careful with ob memory usage
So I checked with memory_get_usage()
There is no memory usage problem at allĀ
F.
Thanks for stepping in,
sorry I forgot to mention that I am building with the 3.3.16
What I could find is returnPageContent('slug');
This works fine for 1 language
The i18n plugin has return_i18n_component('slug') but it returns the output unprocessed
(includes the php tags, quotes and semicolon)
=======================================================
Yes the best working solution seems to make use of PHP output buffering
It works also nice with multi-language and it even allows
chaining api calls:
Working example on a template file:
PHP Code:
<?php
ob_start();
get_page_content();
get_i18n_component('test');
$maincontent .= ob_get_clean();
?>
On the front:
Code:
<div class="">
<?php echo $maincontent ; ?>
</div>
Works flawlessly ...
===========================================================
It is said that you have to be careful with ob memory usage
So I checked with memory_get_usage()
PHP Code:
echo memory_get_usage() . "<br>";
ob_start();
get_page_content();
get_i18n_component('test');
$maincontent .= ob_get_clean();
echo memory_get_usage() . "<br>");
unset($maincontent);
echo memory_get_usage() . "<br>";
There is no memory usage problem at allĀ
F.