GetSimple Support Forum
Link GS to existing WebSite - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: Installation & Setup (http://get-simple.info/forums/forumdisplay.php?fid=5)
+--- Thread: Link GS to existing WebSite (/showthread.php?tid=7149)



Link GS to existing WebSite - rd_evosys - 2015-03-18

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


RE: Link GS to existing WebSite - shawn_a - 2015-03-18

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



RE: Link GS to existing WebSite - rd_evosys - 2015-03-18

Yes, I looked in GetSimple source code and found this function. But I wish you could provide me a better solution Smile

Thx


RE: Link GS to existing WebSite - shawn_a - 2015-03-18

better how ?

That does what you asked.