• Fabrik V4.4.1 is now available.

    This version corrects the Admin issue introduced by V4.4. V4.4.1 is available through the Joomla Updater or for download through your My Downloads area of our website.

    Turns out a code change intended for our 5.0dev branch inadvertantly got pushed to the 4.x branch (by me, duh!). The javascript structure in 5.0 will change considerably and part of that change took effect with the inadvertant code change.

    We have reverted the code change and released 4.4.1. V4.4 has been retracted.

    Sorry for any inconvenience.

  • A new version of Full Calendar is now available.

    See the details here

How to create an XML document of fabrik detail-view template?

Are there easier ways to safe the page loadings in HTML or XML and to load them quicker?

  • Maybe the entire page can be as an RSS-feed?

    Votes: 0 0.0%
  • Maybe PDF file is loaded also faster?

    Votes: 0 0.0%
  • Maybe continue to create a custom XML file with XSL styling?

    Votes: 0 0.0%

  • Total voters
    0

marozen

Member
Loading a webpage can take a lot of time if values are loaded with php from, a large database table. I want to add php code that transforms the loaded page into a XML file. And then with XSL files you can make the page look like a HTML page. And loading it will be much faster and the file can also be loaded at other websites like an RSS-feed.

The code in the default.php template is as followed:

$xml = new DOMDocument("1.0","UTF-8");
$xml->substituteEntities = true;

$stylesheet = new DOMDocument;
$stylesheet->substituteEntities = true;
if ($stylesheet->load("https://rozendale.com/th/rad/plants.xsl") == false)
die('Failed to load XSLT file');

$xml->formatOutput=true;
$root=$xml->createElement('root');
$root->setAttribute('xmlns:xsi', "http://www.w3.org/2001/XMLSchema-instance");
$root->setAttribute('xsi:noNamespaceSchemaLocation', "https://rozendale.com/th/rad/plants.xsd");

$xml->appendChild($root);

$title=$xml->createElement("title", $title);
$root->appendChild($title);

$body=$xml->createElement("body", $body);
$root->appendChild($body);

echo "<xmp>".$xml->saveXML()."</xmp>";
$xml->save("https://rozendale.com/th/rad/p$id.xml") or die("Error,Unable to create XML");

The result is an XML file with $body as an element with the entire html output of the template.

Are there easier ways to safe the page loadings in HTML or XML and to load them quicker?
 
I found another way: To save the output as html-document. And the result is that it loads much faster:

ob_start();
echo $template_content;
file_put_contents("/website/id$id.html", ob_get_contents());
 

Members online

No members online now.
Back
Top