Hi,
I have a custom PHP/MySQL site and use MT for the blog. I really would like to tie the two together and learn a little bit more about how to do so.
Basically, I am looking for a way to show the latest 4 posts on my homepage (which is not controlled by MovableType). I have tried parsing the Atom XML feed using PHP to do this but none of the scripts I have found seem to work.
Could someone point me in the right direction?
Thanks alot,
Ben
Reported on Movable Type 5
Just create a new index template that is outputted as a PHP file that you can include on your main page.
Thanks alot Mike, I will try this.
So if I clone the Main Index template I can include this on a non-movable type page?
How does it find the database? Are we talking about two different things?
You don't need to clone the Main Index. Just click on the create new index template link and create a whole new index template. Then write a combination of PHP code and MT markup to create a PHP include that you can write to a directory where you non-MT site can load that file once it's published.
The database is essentially irrelevant. You'll write a fresh new template which, when published, will be a PHP include. You then modify your non-MT site to do a PHP include or require on that outputted file.
Ben,
What Mike is saying and which I also recommend is that you create a new template that could be called "Blog Include".
The coding that you will put on the new template will be based on the one from the "Main Index" template. You won't put all the coding from the "Main Index" template, but the part starting from <mt:Entries> and ending in </mt:Entries>.
The output of this new "Blog Include" template could be a file called "includes/blog-include.php".
Then you would include this "includes/blog-include.php" file as a php include or require it.
Hope you're following us.
Kind Regards,
Mihai Bocsaru