Commit 358a1aacf1b569d9f59ad7ee67ba481036b952af
Merge remote-tracking branch 'origin/master'
Showing
2 changed files
with
308 additions
and
342 deletions
Show diff stats
frontend/controllers/SiteController.php
... | ... | @@ -6,6 +6,7 @@ |
6 | 6 | use artbox\catalog\models\Category; |
7 | 7 | use artbox\catalog\models\Product; |
8 | 8 | use artbox\core\models\Feedback; |
9 | + use artbox\weblog\models\Article; | |
9 | 10 | use common\models\LoginForm; |
10 | 11 | use common\models\PasswordResetRequestForm; |
11 | 12 | use common\models\ResetPasswordForm; |
... | ... | @@ -93,6 +94,17 @@ |
93 | 94 | ->limit(6) |
94 | 95 | ->with('image') |
95 | 96 | ->all(); |
97 | + $articles = Article::find() | |
98 | + ->orderBy('sort') | |
99 | + ->with( | |
100 | + [ | |
101 | + 'lang', | |
102 | + 'image', | |
103 | + 'category.lang', | |
104 | + ] | |
105 | + ) | |
106 | + ->limit(4) | |
107 | + ->all(); | |
96 | 108 | return $this->render( |
97 | 109 | 'index', |
98 | 110 | [ |
... | ... | @@ -103,6 +115,7 @@ |
103 | 115 | 'productCount' => $productCount, |
104 | 116 | 'brandCount' => $brandCount, |
105 | 117 | 'brands' => $brands, |
118 | + 'articles' => $articles, | |
106 | 119 | ] |
107 | 120 | ); |
108 | 121 | } | ... | ... |
frontend/views/site/index.php
... | ... | @@ -3,7 +3,10 @@ |
3 | 3 | use artbox\catalog\models\Category; |
4 | 4 | use artbox\catalog\models\Product; |
5 | 5 | use artbox\core\components\SeoComponent; |
6 | + use artbox\core\helpers\ImageHelper; | |
7 | + use artbox\weblog\models\Article; | |
6 | 8 | use yii\bootstrap\Html; |
9 | + use yii\helpers\Url; | |
7 | 10 | use yii\web\View; |
8 | 11 | |
9 | 12 | /** |
... | ... | @@ -16,387 +19,337 @@ |
16 | 19 | * @var int $productCount |
17 | 20 | * @var Brand[] $brands |
18 | 21 | * @var SeoComponent $seo |
22 | + * @var Article[] $articles | |
19 | 23 | */ |
20 | 24 | $this->title = 'My Yii Application'; |
21 | 25 | $seo = Yii::$app->get('seo'); |
22 | 26 | ?> |
23 | 27 | <section class="category-carousel-box"> |
24 | - <!-- *** HOMEPAGE CAROUSEL *** | |
28 | + <!-- *** HOMEPAGE CAROUSEL *** | |
25 | 29 | _________________________________________________________ --> |
26 | - <div class="container"> | |
27 | - | |
28 | - <div class="row"> | |
29 | - <div class="col-sm-3"> | |
30 | - <?php | |
31 | - echo $this->render( | |
32 | - '@frontend/views/layouts/_category_menu', | |
33 | - [ | |
34 | - 'isHome' => true, | |
35 | - ] | |
36 | - ); | |
37 | - ?> | |
30 | + <div class="container"> | |
31 | + | |
32 | + <div class="row"> | |
33 | + <div class="col-sm-3"> | |
34 | + <?php | |
35 | + echo $this->render( | |
36 | + '@frontend/views/layouts/_category_menu', | |
37 | + [ | |
38 | + 'isHome' => true, | |
39 | + ] | |
40 | + ); | |
41 | + ?> | |
42 | + </div> | |
43 | + | |
44 | + <div class="col-sm-9"> | |
45 | + <div class="home-carousel"> | |
46 | + | |
47 | + <div class="dark-mask"></div> | |
48 | + | |
49 | + <div class="homepage owl-carousel"> | |
50 | + <div class="item"> | |
51 | + <div class="row"> | |
52 | + <div class="col-sm-5"> | |
53 | + <h1>ะะบัะธะธ | |
54 | + <br>ะธ ัะบะธะดะบะธ</h1> | |
55 | + <p>ะะฐ ะฝะพััะฑัะบะธ | |
56 | + <br>ะธ ะบะพะผะฟัััะตัั | |
57 | + </p> | |
58 | + </div> | |
59 | + <div class="col-sm-7"> | |
60 | + <img class="img-responsive" src="/img/template-homepage.png" alt=""> | |
61 | + </div> | |
62 | + </div> | |
38 | 63 | </div> |
39 | - | |
40 | - <div class="col-sm-9"> | |
41 | - <div class="home-carousel"> | |
42 | - | |
43 | - <div class="dark-mask"></div> | |
44 | - | |
45 | - <div class="homepage owl-carousel"> | |
46 | - <div class="item"> | |
47 | - <div class="row"> | |
48 | - <div class="col-sm-5"> | |
49 | - <h1>ะะบัะธะธ | |
50 | - <br>ะธ ัะบะธะดะบะธ</h1> | |
51 | - <p>ะะฐ ะฝะพััะฑัะบะธ | |
52 | - <br>ะธ ะบะพะผะฟัััะตัั | |
53 | - </p> | |
54 | - </div> | |
55 | - <div class="col-sm-7"> | |
56 | - <img class="img-responsive" src="/img/template-homepage.png" alt=""> | |
57 | - </div> | |
58 | - </div> | |
59 | - </div> | |
60 | - <div class="item"> | |
61 | - <div class="row"> | |
62 | - <div class="col-sm-5"> | |
63 | - <h1>ะะบัะธะธ | |
64 | - <br>ะธ ัะบะธะดะบะธ</h1> | |
65 | - <p>ะะฐ ะฝะพััะฑัะบะธ | |
66 | - <br>ะธ ะบะพะผะฟัััะตัั | |
67 | - </p> | |
68 | - </div> | |
69 | - <div class="col-sm-7"> | |
70 | - <img class="img-responsive" src="/img/template-homepage.png" alt=""> | |
71 | - </div> | |
72 | - </div> | |
73 | - </div> | |
74 | - </div> | |
75 | - <!-- /.project owl-slider --> | |
64 | + <div class="item"> | |
65 | + <div class="row"> | |
66 | + <div class="col-sm-5"> | |
67 | + <h1>ะะบัะธะธ | |
68 | + <br>ะธ ัะบะธะดะบะธ</h1> | |
69 | + <p>ะะฐ ะฝะพััะฑัะบะธ | |
70 | + <br>ะธ ะบะพะผะฟัััะตัั | |
71 | + </p> | |
72 | + </div> | |
73 | + <div class="col-sm-7"> | |
74 | + <img class="img-responsive" src="/img/template-homepage.png" alt=""> | |
76 | 75 | </div> |
76 | + </div> | |
77 | 77 | </div> |
78 | + </div> | |
79 | + <!-- /.project owl-slider --> | |
78 | 80 | </div> |
81 | + </div> | |
79 | 82 | </div> |
80 | - <!-- *** HOMEPAGE CAROUSEL END *** --> | |
83 | + </div> | |
84 | + <!-- *** HOMEPAGE CAROUSEL END *** --> | |
81 | 85 | </section> |
82 | 86 | |
83 | 87 | |
84 | 88 | <section> |
85 | - <div class="container"> | |
86 | - <?php | |
87 | - if (!empty( $newItems )) { | |
88 | - ?> | |
89 | - <div class="heading text-center"> | |
90 | - <h2><?php echo \Yii::t('app', 'ะะพะฒะธะฝะบะธ'); ?></h2> | |
91 | - </div> | |
92 | - | |
93 | - <div class="product-carousel"> | |
94 | - <div class="homepage owl-carousel"> | |
95 | - <?php | |
96 | - $newItemsArrays = array_chunk($newItems, 4); | |
97 | - foreach ($newItemsArrays as $newItemsArray) { | |
98 | - ?> | |
99 | - <div class="products"> | |
100 | - <?php | |
101 | - foreach ($newItemsArray as $product) { | |
102 | - echo $this->render( | |
103 | - '_slider_product', | |
104 | - [ | |
105 | - 'product' => $product, | |
106 | - ] | |
107 | - ); | |
108 | - } | |
109 | - ?> | |
110 | - </div> | |
111 | - <?php | |
112 | - } | |
113 | - ?> | |
114 | - </div> | |
115 | - </div> | |
116 | - <?php | |
117 | - } | |
118 | - if (!empty( $saleItems )) { | |
119 | - ?> | |
120 | - <div class="heading text-center"> | |
121 | - <h2><?php echo \Yii::t('app', 'ะะบัะธะธ'); ?></h2> | |
122 | - </div> | |
123 | - <div class="product-carousel"> | |
124 | - <div class="homepage owl-carousel"> | |
125 | - <?php | |
126 | - $newItemsArrays = array_chunk($saleItems, 4); | |
127 | - foreach ($newItemsArrays as $newItemsArray) { | |
128 | - ?> | |
129 | - <div class="products"> | |
130 | - <?php | |
131 | - foreach ($newItemsArray as $product) { | |
132 | - echo $this->render( | |
133 | - '_slider_product', | |
134 | - [ | |
135 | - 'product' => $product, | |
136 | - ] | |
137 | - ); | |
138 | - } | |
139 | - ?> | |
140 | - </div> | |
141 | - <?php | |
142 | - } | |
143 | - ?> | |
144 | - </div> | |
145 | - </div> | |
146 | - <?php | |
147 | - } | |
148 | - if (!empty( $topItems )) { | |
149 | - ?> | |
150 | - <div class="heading text-center"> | |
151 | - <h2><?php echo \Yii::t('app', 'ะะบัะธะธ'); ?></h2> | |
152 | - </div> | |
153 | - <div class="product-carousel"> | |
154 | - <div class="homepage owl-carousel"> | |
155 | - <?php | |
156 | - $newItemsArrays = array_chunk($topItems, 4); | |
157 | - foreach ($newItemsArrays as $newItemsArray) { | |
158 | - ?> | |
159 | - <div class="products"> | |
160 | - <?php | |
161 | - foreach ($newItemsArray as $product) { | |
162 | - echo $this->render( | |
163 | - '_slider_product', | |
164 | - [ | |
165 | - 'product' => $product, | |
166 | - ] | |
167 | - ); | |
168 | - } | |
169 | - ?> | |
170 | - </div> | |
171 | - <?php | |
172 | - } | |
173 | - ?> | |
174 | - </div> | |
175 | - </div> | |
176 | - <?php | |
177 | - } | |
178 | - ?> | |
179 | - </div> | |
180 | -</section> | |
181 | - | |
182 | -<section class="bar color-white no-mb"> | |
183 | - <div class="container"> | |
184 | - <div class="row showcase"> | |
185 | - <div class="col-md-4 col-sm-6"> | |
186 | - <div class="item"> | |
187 | - <div class="icon"><i class="fa fa-cubes"></i> | |
188 | - </div> | |
189 | - <h4><span class="counter"><?php echo $productCount; ?></span><br> | |
190 | - | |
191 | - ะะพะทะธัะธะน ัะพะฒะฐัะพะฒ</h4> | |
192 | - </div> | |
89 | + <div class="container"> | |
90 | + <?php | |
91 | + if (!empty($newItems)) { | |
92 | + ?> | |
93 | + <div class="heading text-center"> | |
94 | + <h2><?php echo \Yii::t('app', 'ะะพะฒะธะฝะบะธ'); ?></h2> | |
193 | 95 | </div> |
194 | - <div class="col-md-4 col-sm-6"> | |
195 | - <div class="item"> | |
196 | - <div class="icon"><i class="fa fa-tags"></i> | |
197 | - </div> | |
198 | - <h4><span class="counter"><?php echo $brandCount; ?></span><br> | |
199 | - | |
200 | - ะัะตะฝะดะพะฒ</h4> | |
201 | - </div> | |
96 | + | |
97 | + <div class="product-carousel"> | |
98 | + <div class="homepage owl-carousel"> | |
99 | + <?php | |
100 | + $newItemsArrays = array_chunk($newItems, 4); | |
101 | + foreach ($newItemsArrays as $newItemsArray) { | |
102 | + ?> | |
103 | + <div class="products"> | |
104 | + <?php | |
105 | + foreach ($newItemsArray as $product) { | |
106 | + echo $this->render( | |
107 | + '_slider_product', | |
108 | + [ | |
109 | + 'product' => $product, | |
110 | + ] | |
111 | + ); | |
112 | + } | |
113 | + ?> | |
114 | + </div> | |
115 | + <?php | |
116 | + } | |
117 | + ?> | |
118 | + </div> | |
202 | 119 | </div> |
203 | - <div class="col-md-4 col-sm-6"> | |
204 | - <div class="item"> | |
205 | - <div class="icon"><i class="fa fa-copy"></i> | |
206 | - </div> | |
207 | - <h4><span class="counter">12</span> ... <span class="counter">36</span><br> | |
208 | - | |
209 | - ะะตัััะตะฒ ะะฐัะฐะฝัะธั </h4> | |
210 | - </div> | |
120 | + <?php | |
121 | + } | |
122 | + if (!empty($saleItems)) { | |
123 | + ?> | |
124 | + <div class="heading text-center"> | |
125 | + <h2><?php echo \Yii::t('app', 'ะะบัะธะธ'); ?></h2> | |
211 | 126 | </div> |
212 | - </div> | |
213 | - <!-- /.row --> | |
214 | - </div> | |
215 | - <!-- /.container --> | |
216 | -</section> | |
217 | -<!-- /.bar --> | |
218 | -<?php | |
219 | - if (!empty( $brands )) { | |
220 | - ?> | |
221 | - <section class="bar background-gray no-mb"> | |
222 | - <div class="container"> | |
223 | - <div class="row"> | |
224 | - <div class="col-md-12"> | |
225 | - <div class="heading text-center"> | |
226 | - <h2><?php echo \Yii::t('app', 'ะัะตะฝะดั'); ?></h2> | |
127 | + <div class="product-carousel"> | |
128 | + <div class="homepage owl-carousel"> | |
129 | + <?php | |
130 | + $newItemsArrays = array_chunk($saleItems, 4); | |
131 | + foreach ($newItemsArrays as $newItemsArray) { | |
132 | + ?> | |
133 | + <div class="products"> | |
134 | + <?php | |
135 | + foreach ($newItemsArray as $product) { | |
136 | + echo $this->render( | |
137 | + '_slider_product', | |
138 | + [ | |
139 | + 'product' => $product, | |
140 | + ] | |
141 | + ); | |
142 | + } | |
143 | + ?> | |
227 | 144 | </div> |
228 | - | |
229 | - <ul class="owl-carousel customers"> | |
145 | + <?php | |
146 | + } | |
147 | + ?> | |
148 | + </div> | |
149 | + </div> | |
150 | + <?php | |
151 | + } | |
152 | + if (!empty($topItems)) { | |
153 | + ?> | |
154 | + <div class="heading text-center"> | |
155 | + <h2><?php echo \Yii::t('app', 'ะะบัะธะธ'); ?></h2> | |
156 | + </div> | |
157 | + <div class="product-carousel"> | |
158 | + <div class="homepage owl-carousel"> | |
159 | + <?php | |
160 | + $newItemsArrays = array_chunk($topItems, 4); | |
161 | + foreach ($newItemsArrays as $newItemsArray) { | |
162 | + ?> | |
163 | + <div class="products"> | |
230 | 164 | <?php |
231 | - foreach ($brands as $brand) { | |
232 | - echo Html::tag( | |
233 | - 'div', | |
234 | - Html::img( | |
235 | - $brand->image->getUrl(), | |
236 | - [ | |
237 | - 'class' => 'img-responsive', | |
238 | - ] | |
239 | - ), | |
165 | + foreach ($newItemsArray as $product) { | |
166 | + echo $this->render( | |
167 | + '_slider_product', | |
240 | 168 | [ |
241 | - 'class' => 'item', | |
169 | + 'product' => $product, | |
242 | 170 | ] |
243 | 171 | ); |
244 | 172 | } |
245 | 173 | ?> |
246 | - </ul> | |
247 | - <!-- /.owl-carousel --> | |
248 | - </div> | |
249 | - | |
250 | - </div> | |
174 | + </div> | |
175 | + <?php | |
176 | + } | |
177 | + ?> | |
178 | + </div> | |
179 | + </div> | |
180 | + <?php | |
181 | + } | |
182 | + ?> | |
183 | + </div> | |
184 | +</section> | |
185 | + | |
186 | +<section class="bar color-white no-mb"> | |
187 | + <div class="container"> | |
188 | + <div class="row showcase"> | |
189 | + <div class="col-md-4 col-sm-6"> | |
190 | + <div class="item"> | |
191 | + <div class="icon"><i class="fa fa-cubes"></i> | |
192 | + </div> | |
193 | + <h4><span class="counter"><?php echo $productCount; ?></span><br> | |
194 | + | |
195 | + ะะพะทะธัะธะน ัะพะฒะฐัะพะฒ</h4> | |
196 | + </div> | |
197 | + </div> | |
198 | + <div class="col-md-4 col-sm-6"> | |
199 | + <div class="item"> | |
200 | + <div class="icon"><i class="fa fa-tags"></i> | |
201 | + </div> | |
202 | + <h4><span class="counter"><?php echo $brandCount; ?></span><br> | |
203 | + | |
204 | + ะัะตะฝะดะพะฒ</h4> | |
205 | + </div> | |
206 | + </div> | |
207 | + <div class="col-md-4 col-sm-6"> | |
208 | + <div class="item"> | |
209 | + <div class="icon"><i class="fa fa-copy"></i> | |
210 | + </div> | |
211 | + <h4><span class="counter">12</span> ... <span class="counter">36</span><br> | |
212 | + | |
213 | + ะะตัััะตะฒ ะะฐัะฐะฝัะธั </h4> | |
214 | + </div> | |
215 | + </div> | |
216 | + </div> | |
217 | + <!-- /.row --> | |
218 | + </div> | |
219 | + <!-- /.container --> | |
220 | +</section> | |
221 | +<!-- /.bar --> | |
222 | +<?php | |
223 | + if (!empty($brands)) { | |
224 | + ?> | |
225 | + <section class="bar background-gray no-mb"> | |
226 | + <div class="container"> | |
227 | + <div class="row"> | |
228 | + <div class="col-md-12"> | |
229 | + <div class="heading text-center"> | |
230 | + <h2><?php echo \Yii::t('app', 'ะัะตะฝะดั'); ?></h2> | |
231 | + </div> | |
232 | + | |
233 | + <ul class="owl-carousel customers"> | |
234 | + <?php | |
235 | + foreach ($brands as $brand) { | |
236 | + echo Html::tag( | |
237 | + 'div', | |
238 | + Html::img( | |
239 | + $brand->image->getUrl(), | |
240 | + [ | |
241 | + 'class' => 'img-responsive', | |
242 | + ] | |
243 | + ), | |
244 | + [ | |
245 | + 'class' => 'item', | |
246 | + ] | |
247 | + ); | |
248 | + } | |
249 | + ?> | |
250 | + </ul> | |
251 | + <!-- /.owl-carousel --> | |
251 | 252 | </div> |
252 | - </section> | |
253 | + | |
254 | + </div> | |
255 | + </div> | |
256 | + </section> | |
253 | 257 | <?php |
254 | 258 | } |
255 | 259 | ?> |
256 | -<?php | |
257 | - /* ะะพะปะตะทะฝัะต ััะฐััะธ | |
258 | 260 | <section class="bar background-white no-mb"> |
259 | - <div class="container"> | |
260 | - | |
261 | - <div class="col-md-12"> | |
262 | - <div class="heading text-center"> | |
263 | - <h2>ะะพะปะตะทะฝัะต ััะฐััะธ</h2> | |
264 | - </div> | |
265 | - | |
266 | - <p class="lead">Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies | |
267 | - mi vitae est. Mauris placerat eleifend leo. <span class="accent">Check our blog!</span> | |
268 | - </p> | |
269 | - | |
270 | - <!-- *** BLOG HOMEPAGE *** | |
261 | + <div class="container"> | |
262 | + | |
263 | + <div class="col-md-12"> | |
264 | + <div class="heading text-center"> | |
265 | + <h2>ะะพะปะตะทะฝัะต ััะฐััะธ</h2> | |
266 | + </div> | |
267 | + | |
268 | + <p class="lead">Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies | |
269 | + mi vitae est. Mauris placerat eleifend leo. <span class="accent">Check our blog!</span> | |
270 | + </p> | |
271 | + | |
272 | + <!-- *** BLOG HOMEPAGE *** | |
271 | 273 | _________________________________________________________ --> |
272 | - | |
273 | - <div class="row"> | |
274 | - <div class="col-md-3 col-sm-6"> | |
275 | - <div class="box-image-text blog"> | |
276 | - <div class="top"> | |
277 | - <div class="image"> | |
278 | - <img src="/img/portfolio-4.jpg" alt="" class="img-responsive"> | |
279 | - </div> | |
280 | - <div class="bg"></div> | |
281 | - <div class="text"> | |
282 | - <p class="buttons"> | |
283 | - <a href="blog-post.html" class="btn btn-template-transparent-primary"><i class="fa fa-link"></i> Read more</a> | |
284 | - </p> | |
285 | - </div> | |
286 | - </div> | |
287 | - <div class="content"> | |
288 | - <h4><a href="blog-post.html">Fashion now</a></h4> | |
289 | - <p class="author-category">By <a href="#">John Snow</a> in <a href="blog.html">Webdesign</a> | |
290 | - </p> | |
291 | - <p class="intro">Fifth abundantly made Give sixth hath. Cattle creature i be don't them behold green moved fowl Moved life us beast good yielding. Have bring.</p> | |
292 | - <p class="read-more"> | |
293 | - <a href="blog-post.html" class="btn btn-template-main">Continue reading</a> | |
294 | - </p> | |
295 | - </div> | |
296 | - </div> | |
297 | - <!-- /.box-image-text --> | |
298 | - | |
299 | - </div> | |
300 | - | |
301 | - <div class="col-md-3 col-sm-6"> | |
302 | - <div class="box-image-text blog"> | |
303 | - <div class="top"> | |
304 | - <div class="image"> | |
305 | - <img src="/img/portfolio-3.jpg" alt="" class="img-responsive"> | |
306 | - </div> | |
307 | - <div class="bg"></div> | |
308 | - <div class="text"> | |
309 | - <p class="buttons"> | |
310 | - <a href="blog-post.html" class="btn btn-template-transparent-primary"><i class="fa fa-link"></i> Read more</a> | |
311 | - </p> | |
312 | - </div> | |
313 | - </div> | |
314 | - <div class="content"> | |
315 | - <h4><a href="blog-post.html">Fashion now</a></h4> | |
316 | - <p class="author-category">By <a href="#">John Snow</a> in <a href="blog.html">Webdesign</a> | |
317 | - </p> | |
318 | - <p class="intro">Fifth abundantly made Give sixth hath. Cattle creature i be don't them behold green moved fowl Moved life us beast good yielding. Have bring.</p> | |
319 | - <p class="read-more"> | |
320 | - <a href="blog-post.html" class="btn btn-template-main">Continue reading</a> | |
321 | - </p> | |
322 | - </div> | |
323 | - </div> | |
324 | - <!-- /.box-image-text --> | |
325 | - | |
326 | - </div> | |
327 | - | |
328 | - <div class="col-md-3 col-sm-6"> | |
329 | - <div class="box-image-text blog"> | |
330 | - <div class="top"> | |
331 | - <div class="image"> | |
332 | - <img src="/img/portfolio-5.jpg" alt="" class="img-responsive"> | |
333 | - </div> | |
334 | - <div class="bg"></div> | |
335 | - <div class="text"> | |
336 | - <p class="buttons"> | |
337 | - <a href="blog-post.html" class="btn btn-template-transparent-primary"><i class="fa fa-link"></i> Read more</a> | |
338 | - </p> | |
339 | - </div> | |
340 | - </div> | |
341 | - <div class="content"> | |
342 | - <h4><a href="blog-post.html">What to do</a></h4> | |
343 | - <p class="author-category">By <a href="#">John Snow</a> in <a href="blog.html">Webdesign</a> | |
344 | - </p> | |
345 | - <p class="intro">Fifth abundantly made Give sixth hath. Cattle creature i be don't them behold green moved fowl Moved life us beast good yielding. Have bring.</p> | |
346 | - <p class="read-more"> | |
347 | - <a href="blog-post.html" class="btn btn-template-main">Continue reading</a> | |
348 | - </p> | |
349 | - </div> | |
350 | - </div> | |
351 | - <!-- /.box-image-text --> | |
352 | - | |
274 | + | |
275 | + <div class="row"> | |
276 | + | |
277 | + <?php foreach ($articles as $article) { ?> | |
278 | + <div class="col-md-3 col-sm-6"> | |
279 | + <div class="box-image-text blog"> | |
280 | + <div class="top"> | |
281 | + <div class="image"> | |
282 | + <?= ImageHelper::set( | |
283 | + $article->image ? $article->image->getPath() : '@frontend/web/img/no-image.png' | |
284 | + ) | |
285 | + ->cropResize(255, 192) | |
286 | + ->renderImage( | |
287 | + [ | |
288 | + 'class' => 'img-responsive', | |
289 | + 'alt' => $article->lang->title, | |
290 | + ] | |
291 | + ) ?> | |
292 | + </div> | |
293 | + <div class="bg"></div> | |
294 | + <div class="text"> | |
295 | + <p class="buttons"> | |
296 | + <a href="<?= Url::to( | |
297 | + [ | |
298 | + 'blog/article', | |
299 | + 'id' => $article->id, | |
300 | + ] | |
301 | + ) ?>" class="btn btn-template-transparent-primary"><i class="fa fa-link"></i> Read more</a> | |
302 | + </p> | |
303 | + </div> | |
353 | 304 | </div> |
354 | - | |
355 | - <div class="col-md-3 col-sm-6"> | |
356 | - <div class="box-image-text blog"> | |
357 | - <div class="top"> | |
358 | - <div class="image"> | |
359 | - <img src="/img/portfolio-6.jpg" alt="" class="img-responsive"> | |
360 | - </div> | |
361 | - <div class="bg"></div> | |
362 | - <div class="text"> | |
363 | - <p class="buttons"> | |
364 | - <a href="blog-post.html" class="btn btn-template-transparent-primary"><i class="fa fa-link"></i> Read more</a> | |
365 | - </p> | |
366 | - </div> | |
367 | - </div> | |
368 | - <div class="content"> | |
369 | - <h4><a href="blog-post.html">5 ways to look awesome</a></h4> | |
370 | - <p class="author-category">By <a href="#">John Snow</a> in <a href="blog.html">Webdesign</a> | |
371 | - </p> | |
372 | - <p class="intro">Am terminated it excellence invitation projection as. She graceful shy believed distance use nay. Lively is people.</p> | |
373 | - <p class="read-more"> | |
374 | - <a href="blog-post.html" class="btn btn-template-main">Continue reading</a> | |
375 | - </p> | |
376 | - </div> | |
377 | - </div> | |
378 | - <!-- /.box-image-text --> | |
379 | - | |
305 | + <div class="content"> | |
306 | + <h4><a href="<?= Url::to( | |
307 | + [ | |
308 | + 'blog/article', | |
309 | + 'id' => $article->id, | |
310 | + ] | |
311 | + ) ?>"><?= $article->lang->title; ?></a></h4> | |
312 | + <?php if ( !empty($article->category) ) { ?> | |
313 | + <p class="author-category"><a href="<?= Url::to( | |
314 | + [ | |
315 | + 'blog/category', | |
316 | + 'id' => $article->category->id, | |
317 | + ] | |
318 | + ) ?>"><?= $article->category->lang->title ?></a> | |
319 | + <?php } ?> | |
320 | + </p> | |
321 | + <p class="intro"><?= $article->lang->body_preview; ?></p> | |
322 | + <p class="read-more"> | |
323 | + <a href="<?= Url::to( | |
324 | + [ | |
325 | + 'blog/article', | |
326 | + 'id' => $article->id, | |
327 | + ] | |
328 | + ) ?>" class="btn btn-template-main">Continue reading</a> | |
329 | + </p> | |
380 | 330 | </div> |
381 | - | |
331 | + </div> | |
332 | + <!-- /.box-image-text --> | |
382 | 333 | </div> |
383 | - <!-- /.row --> | |
384 | - | |
385 | - <!-- *** BLOG HOMEPAGE END *** --> | |
386 | - | |
387 | - </div> | |
334 | + <?php } ?> | |
335 | + | |
336 | + </div> | |
337 | + <!-- /.row --> | |
338 | + | |
339 | + <!-- *** BLOG HOMEPAGE END *** --> | |
388 | 340 | |
389 | 341 | </div> |
390 | - <!-- /.container --> | |
342 | + | |
343 | + </div> | |
344 | + <!-- /.container --> | |
391 | 345 | </section> |
392 | 346 | <!-- /.bar --> |
393 | - */ | |
394 | -?> | |
347 | + | |
395 | 348 | |
396 | 349 | <section class="bar background-white no-mb"> |
397 | - <div class="container"> | |
398 | - <div class="col-md-12"> | |
399 | - <?php echo $seo->text; ?> | |
400 | - </div> | |
350 | + <div class="container"> | |
351 | + <div class="col-md-12"> | |
352 | + <?php echo $seo->text; ?> | |
401 | 353 | </div> |
354 | + </div> | |
402 | 355 | </section> | ... | ... |