Login | Forgot password | Register

X

What is OpenID?

OpenID is an Internet-wide identity system that allows you to sign in to many websites with a single account.

With OpenID, your ID becomes a URL (e.g. http://username.myopenid.com/). You can get a free OpenID for example from myopenid.com.

For more information visit the official OpenID site.

Jump to:

179 Posts in 40 Topics by 85 members

Migrating a Site to Silverstripe

SilverStripe Forums » Migrating a Site to Silverstripe » Inlclude output of SS in own page.

What you need to know when migrating your existing site to SilverStripe.

Page: 1
Go to End
Author Topic: Inlclude output of SS in own page. 818 Views
  • markotondria
    avatar
    Community Member
    13 posts

    Inlclude output of SS in own page. Link to this post

    Hi -
    I have a current site that uses ajax to pipe page contents into a div on my front page, the url of which doesnt change.
    I am looking to use the CMS of silverstripe to produce templated, updatable pages, that I can then pipe through to my current page layout.
    I have tried using:

    ob_start();

    include 'SilverStripe/sapphire/main.php?url=/my-news_page';

    $result = ob_get_clean();

    echo $result;

    within my current ajax script, but I get no results.
    In my page.ss I have stripped out everything except the $Layout var.

    When I go to
    www.mysite.com/SilverStripe/sapphire/main.php?url=/my-news_page
    I see the markout output correctly, and it is this that I want to appear in my div on my front page..

    Is there any setting or security variables that I need to adjust so that SS will be happy sending the output to my 'include' ?

    Many thanks

    Mike.

  • markotondria
    avatar
    Community Member
    13 posts

    Re: Inlclude output of SS in own page. Link to this post

    Well, as foolish as I might appear by answering my own question in such a quick time, I will not be proud, but post my solution..

    I used

    $thefiletoopen = 'mysite.com/SilverStripe/sapphire/main.php?url=/my-news-page/';
    $fileHandle = fopen($thefiletoopen, 'r');
    $fileData = fread ($fileHandle, 10000);
    echo $fileData;

    and all was well.

    818 Views
Page: 1
Go to Top

Currently Online: mandrew, Dragon28, oldwrinkly

Welcome to our latest member: U

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.