_article.php 1.38 KB
Newer Older
Яков's avatar
first  
Яков committed
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
<?php
$culture = $sf_user->getCulture();
if (isset($articles) && count($articles) > 0) {
    $module_action = $sf_request->getParameter('module') . '_' . $sf_request->getParameter('action');
    $html = '';
    ob_start();
//
//    print_r($articles);
//    die();
    foreach ($articles as $article) {
        ?>
        <div class="articles_item">
            <a href="<?php echo url_for('@article_show?alias=' . $article['alias']); ?>" class="anb">
                <img src="/i/n.gif" class="articles_item__img" style="background-image: url(/u/i/<?php echo Page::replaceImageSize($article['cover'], 'S'); ?>)"/>
                <span class="articles_item__link green_link"><?php echo $article['Translation'][$culture]['title']; ?></span>
                <i class="br5"></i>
                <span class="articles_item__text black_link"><?php echo $article['Translation'][$culture]['description']; ?></span>
            </a>
        </div>
        <?php
    }
    $html = ob_get_contents();
    ob_end_clean();
    if($module_action == 'product_show'){
        echo '<div class="product_section product__articles">';
        echo '<div class="caption"><a class="green_link" href="/' . $culture . '/article/?tag_id=' . $tag_id . '">' . __('Статьи') . '</a></div>';
        echo '<div class="max_width">' . $html . '</div>';
        echo '</div>';
    }else{
        echo $html;
    }
}
if ($die)
    die();
?>