<div class="list-news">
    <?php  if(!empty ($this->newsCategoriesArray) && !empty ($this->newsArray)) {?>
        <?php foreach ($this->newsCategoriesArray as $category){?>
          <div class="news-category-name"><?php echo $category['newsCategoryName']; ?> </div>
          <?php foreach ($this->newsArray as $newsItem) {?>
              <?php if($newsItem['newsCategoryId'] == $category['newsCategoryId']){?>
        <div class="news-item">
            <h4><span><a href="<?php echo $this->siteUrl. $this->newsFolder . '/' .$newsItem["newsUrl"].'.html';?>" title="<?php echo $newsItem['newsTitle'];?>"><?php echo $newsItem['newsTitle'];?></a></span> </h4>
            <h4><span><?php echo $newsItem['newsDate'];?></span> </h4>
            <div class="news-item-description"><?php echo $newsItem['newsIntro']; ?></div>
        </div>
              <?php }?>
          <?php }?>
<?php }?>
<?php }?>

<?php  if(!empty($this->newsArrayWithoutCategory)){ ?>
  <div class="news-category-name">Without category</div>
       <?php foreach ($this->newsArrayWithoutCategory as $newsItem) {?>
        <div class="news-item">
            <h4><span><a href="<?php echo $this->siteUrl. $this->newsFolder . '/' .$newsItem["newsUrl"].'.html';?>" title="<?php echo $newsItem['newsTitle'];?>"><?php echo $newsItem['newsTitle'];?></a></span> </h4>
            <h4><span><?php echo $newsItem['newsDate'];?></span> </h4>
            <div class="news-item-description"><?php echo $newsItem['newsIntro']; ?></div>
        </div>
          <?php }?>
<?php }?>
</div>

