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

 

Designing an category.php template script for Easy Magazine

The category.php script show all articles related to a gived category.
It is very useful for reader if you put in the top of the page the name of the catogory followed by the list of all his articles. For each article it is possible to see: the title, the author, the link to the related comments page and the subject.
The subject can contain images.

Homepage of a magazine published using Easy Magazine

Accessible data:

  • $this->category:
  • contains data about the category selected (Category)
  • $this->articles:
  • contains a list of articles (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(s))
  • $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:

					

<?= $this->category->getName() ?>

<?= $this->category->getDescription() ?>
<? foreach($this->articles as $article) : ?> <? $URL = URIMaker::article($article); ?>

<? echo "<?= $article->getTitle() ?>" ?>

<?= $article->getCreatedFormatted() ?> by <?= $article->auhorsNamesConcatenation() ?> | <? $URL = URIMaker::comment($article); $commentsNumber = count($article->commentsPublished()); ?> <? echo " comments ($commentsNumber) "; ?>
<?= $article->getSummary() ?>
<? endforeach; ?>
<?= $this->paginator->renderFullNav(URIMaker::category($this->category)) ?>

 


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