ArticleMs: How To Add The Latest Articles Into an External Page




Many are looking for a way to add the latest articles/news from the articlems directory to the external home page.

This happen when one have articlems into a subfolder ( ie your site . com / articles )

This system works only if the external page has the extension .php ( ie index.php and not index.html) and if you have the script installed in a subfolder.

The first thing is to create a new Standalone Block

So goto your admin — edit templates

CREATE NEW BLOCK
call it as you like (ie HomePageNews) and set it as STANDALONE

then in the HTML part of the block put this code

<h1>Latest News and Update</h1>
<br>

{section name=$this->i  loop=$this->articles}
<a href=’{$this->relpath}latest/’>{$this->articles[$this->i]->title}</a>

<div>
{if $this->articles[$this->i]->summary}
{$this->articles[$this->i]->summary}
{else}
{$this->articles[$this->i]->text|summary}
{/if}
</div>

<h2><a href=’yoursitename.com/latest’>Read More</a></h2>

{/section}


and in the PHP part put

$this->articles = $this->getArticles(”,’article_id DESC’,10);

$this->bypass_cms = 1;


then add this line of code into your external home page
(but it must have the .php extension and not html)

<?php include(‘http://yoursitename.com/articles/LatestHome/’); ?>

(of course change the site address with your site name/subfolder)

As said this can work if the external page has the .php (ie index.php) and not html (ie index.html)

Hope this can help you
:)

About the Author

Blooobs has written 43 stories on this site.

Write a Comment

Gravatars are small images that can show your personality. You can get your gravatar for free today!

Security Code:

Copyright © 2012 ArticleMs Templates And Article Marketing. All rights reserved.