Homepage of www.easymagazine.net | Wem site map of www.easymagazine.net | Email the author of www.easymagazine.net

 

Designing an index.php template page for Easy Magazine

The results.php shows all the articles resulting from a query.
This query is a full text research in all articles of the magazine and is called from the small form "Search" in the menu of the magazine.

Homepage of a magazine published using Easy Magazine

Accessible data:

  • $this->articles:
  • contains last number published (array Article(s))
  • $this->number:
  • contains last number published (Number)
  • $this->numbers:
  • array with the last 10 numbers published (array Number(s))
  • $this->categories:
  • array containing all categories of the magazine (array Category(s))
  • $this->pages:
  • array containing all pages published (array Page)
  • $this->metadescritpion:
  • string containing the metadescription of the page (String)
  • $this->metakeywords:
  • string containing the metadescription of the page (String)
  • $this->title:
  • string created to fill the title tag (String)

An example of code:

<? if (isset($this->advice)) :?>
<p><?= $this->advice ?></p>
<? endif; ?>

<? foreach($this->articles as $article) { ?>
<h2>
<? echo '<a href="'.URIMaker::article($article).'"> '.$article->getTitle()." </a>"; ?>
</h2>

<div class="date"><small><?= $article->getCreatedFormatted() ?></small> by
<?
foreach ($article->users() as $user) {
echo $user->getName().' ';
}
?>
</div>

<div class="entry">

<?= $article->getSummary() ?>
</div>

<p class="date">
<? echo '<a href="'.URIMaker::comment($article).'"> comments ('.count($article->commentsPublished()).') </a>'; ?>
</p>

<? } ?>

<p>
<?= $_SESSION['paginator']->renderFullNav(URIMaker::result()) ?>
</p>

 


Copyright © 2009, 2010, 2011 Fabio Mattei, designed by zuudesign.sk