leider funktioniert es nicht, wenn TOP News ausgewält sind, dass diese auch an der ersten stelle bleiben.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | <?php $articles = $this ->get( 'articles' ); $adminAccess = null; if ( $this ->getUser()) { $adminAccess = $this ->getUser()->isAdmin(); } ?> <?php $article_count = count ( $articles ); if ( count ( $articles ) > 0) { for ( $i = 0; $i < $article_count ; $i ++) { $article = $articles [ $i ]; $date = new \Ilch\ Date ( $article ->getDateCreated()); $title = $this ->escape( $article ->getTitle()); $author = $this ->escape( $article ->getAuthorName()); $author_url = $this ->getUrl([ 'module' => 'user' , 'controller' => 'profil' , 'action' => 'index' , 'user' => $article ->getAuthorId()]); $date_formatted = $date ->format( 'd.' , true) . " " . $this ->getTrans( $date ->format( 'F' , true)) . " " . $date ->format( 'Y' , true); $content = $article ->getContent(); $content = substr ( $content , 0, 100); $img = $this ->getBaseUrl( $article ->getImage()); $imgSource = $this ->getBaseUrl( $article ->getImageSource()); if (! empty ( $img )) { $imgURL = $img ; } else { $imgURL = $imgSource ; } if ( $i == 0) { //Großes echo "<div class = 'col-lg-6' > <div class = 'NewsBoxes' > <div class = 'imgDesc' > <img class = 'img' src= '$imgURL' > <div class = 'dateCat' > <div class = 'btnN' > $date_formatted </div> <div class = 'btnN' ><a class = 'newsbutton-lg' style= 'color: black;' href= '{$this->getUrl([' module ' => ' user ', ' controller ' => ' profil ', ' action ' => ' index ', ' user ' => $article->getAuthorId()])}' target= '_blank' > $author </a></div> </div> <div class = 'desc' > <div class = 'inner' > <h3> $title </h3> <a class = 'newsbutton-lg' href= '{$this->getUrl([' module ' => ' article ', ' controller ' => ' index ', ' action ' => ' show ', ' id ' => $article->getId()])}' target= '_blank' >Read More</a> </div> </div> </div> </div> </div> <div class = 'col-lg-6 order-0 order-lg-2' > <div class = 'row' > <div class = 'col' > <div class = 'newsSmall' >"; } else if ( $i < 4) { //Drei kleine echo "<a href= '{$this->getUrl([' module ' => ' article ', ' controller ' => ' index ', ' action ' => ' show ', ' id ' => $article->getId()])}' > <div class = 'object boxes mgb' > <img class = 'img' src= '$imgURL' > <div class = 'pad' > <div class = 'row' > <div class = 'col-md-2 col-xs-3' > <img class = 'newsImgSmallN2' src= '$imgURL' > </div> <div class = 'col-md-10 col-xs-9' > <div class = 'smallcat' > <div class = 'btnsN' > $date_formatted </div> </div> <a href= '{$this->getUrl([' module ' => ' article ', ' controller ' => ' index ', ' action ' => ' show ', ' id ' => $article->getId()])}' ><h3> $title </h3></a> </div> </div> </div> </div> </a>"; } } echo "</div> </div> </div> </div>"; } else { echo $this ->getTrans( 'noArticles' ); } ?> |
verwendete ilch Version: 2.1.x
betroffene Homepage: localhost