ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

posts on a seperate .php page

September 14, 2009 4:01pm

Subscribe [3]
  • #1 / Sep 14, 2009 4:01pm

    griffithstoby

    25 posts

    hello everybody,

    I was wondering how to put posts or the post titles on a seperate page. I mean a page outside of my EE installation/blog. Still part of the same site but just nothing to do with the blog.

    I am thinking when sites have their ‘latest news headlines’ on their front pages. this then links to their latest blog entries.

    Thanks
    Toby

  • #2 / Sep 14, 2009 4:06pm

    Ingmar

    29245 posts

    You’ll probably want to use an RSS feed for that.

  • #3 / Sep 14, 2009 4:08pm

    griffithstoby

    25 posts

    ah, ok, my RSS feed from my blog.

    but how do I get it to display what I want on the page?

    thanks,
    Toby

  • #4 / Sep 14, 2009 4:27pm

    Ingmar

    29245 posts

    For EE, there is the Magpie plugin. I believe there is a stand-alone PHP version, too, as well as a large number of other mechanisms to display RSS/Atom feeds in your website.

  • #5 / Sep 14, 2009 4:31pm

    Lisa Wess

    20502 posts

    Another option, possibly simpler than working with Magpie, would be to use an iFrame.

  • #6 / Sep 14, 2009 5:18pm

    Focus Lab Dev Team

    1129 posts

    I’d suggest making an EE template just with the output that you want and then using file_get_contents() to pull it into your other php page. Your ee template could be something like

    <ul>
    {exp:weblog:entries weblog="my_weblog" disable="custom_fields|categories|category_fields|member_data|pagination|trackbacks" dynamic="off" limit="5"}
    {if no_results}
       <li>No Results</li>
    {/if}
       <li><a href="http://{path=blog/comments">{title}</a></li>
    {/exp:weblog:entries}
    </ul>

    and your PHP file could have something like this in it

    <h3>Latest News Headlines</h3>
    <p><? echo file_get_contents("http://mysite.com/blog/latest_headlines/");?>

    The file_get_contents function stores the contents in a string in PHP. You can read about it here: PHP:// file_get_contents

  • #7 / Sep 17, 2009 5:25pm

    griffithstoby

    25 posts

    thanks, Erik and everyone,

    that worked well. Very simple.

    I’d suggest making an EE template just with the output that you want and then using file_get_contents() to pull it into your other php page.

    thanks
    Toby

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases