GetSimple Support Forum

Full Version: Link GS to existing WebSite
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I've created a website for one of our client. Now, I would like to link it with GS.

I think first that I could include GS pages into my website (includes('GS/data/pages/footer.xml')Wink.

However, GS generate XML. So, how can I include those XML files into my website ?

The purpose is to give my client an easy way to edit static files such as content or footer.

PS : The site is built in PHP

Thx,

Rob
Things like this will not be easy to do until 3.4.

You could always load the xml on your own in php and just use our code.


psuedocode
PHP Code:
/**
 * Get XML Data
 *
 * Turns the XML file into an object 
 *
 * @since 1.0
 *
 * @param string $file
 * @return object
 */
function getXML($file,$nocdata true) {
    
$xml file_get_contents($file);
    if(
$xml){
        
$data simplexml_load_string($xml'SimpleXMLExtended'$nocdata LIBXML_NOCDATA null);
        return 
$data;
    }    
}

$page getXML('data/pages/mypage.xml');
echo 
$page->content
Yes, I looked in GetSimple source code and found this function. But I wish you could provide me a better solution Smile

Thx
better how ?

That does what you asked.