mavince 0 Posted August 12, 2018 Report Share Posted August 12, 2018 подскажи как сделать так чтоб была видно картинка рядом с заголовком так, что-то не очень выглядит Link to post Share on other sites
support 447 Posted August 12, 2018 Report Share Posted August 12, 2018 3 часа назад, mavince сказал: подскажи как сделать так чтоб была видно картинка рядом с заголовком так, что-то не очень выглядит В Админке - Оформление - Шаблоны - Шаблон категории меняйте: {if $sub_count->value.pages > 0 or $sub_count->value.news > 0 or $sub_count->value.articles > 0} <div class="content_listing"> <ul> {content_listing template="links" parent={$content_id} page={$page}} </ul> </div> {/if} на: {if $sub_count->value.pages > 0 or $sub_count->value.news > 0 or $sub_count->value.articles > 0} <div class="content_listing"> <ul> {content_listing template="news-listing" parent={$content_id} page={$page}} </ul> </div> {/if} В Админке - Оформление - Шаблоны - Микро-шаблоны создайте шаблон news-listing по аналогии с шаблоном links Затем в шаблоне news-listing добавьте вывод картинки, например так: <a href="{$node.url}" class="image"><img src="{$node.image}" alt="{$node.name}"{if {$node.image_width} > 0} width="{$node.image_width}"{/if}{if {$node.image_height} > 0} height="{$node.image_height}"{/if} /> Link to post Share on other sites
mavince 0 Posted August 12, 2018 Author Report Share Posted August 12, 2018 получилось, только когда следующую выкладываешь, с предыдущей картинка уходит, Link to post Share on other sites
support 447 Posted August 12, 2018 Report Share Posted August 12, 2018 Куда вставили этот код для вывода картинки?! Покажите шаблон. Нарвеное код неправильно вставили. Код должен находиться внутри foreach ... /foreach 2 минуты назад, mavince сказал: получилось, только когда следующую выкладываешь, с предыдущей картинка уходит, Link to post Share on other sites
mavince 0 Posted August 13, 2018 Author Report Share Posted August 13, 2018 {foreach from=$content_list item=node} <li{if $node.alias == $content_alias} class="active"{/if}><a href="{$node.url}">{$node.name}</a></li> {/foreach} <a href="{$node.url}" class="image"><img src="{$node.image}" alt="{$node.name}"{if {$node.image_width} > 0} width="{$node.image_width}"{/if}{if {$node.image_height} > 0} height="{$node.image_height}"{/if} /> а надо так? {foreach from=$content_list item=node} <li{if $node.alias == $content_alias} class="active"{/if}><a href="{$node.url}">{$node.name}</a></li> {foreach<a href="{$node.url}" class="image"><img src="{$node.image}" alt="{$node.name}"{if {$node.image_width} > 0} width="{$node.image_width}"{/if}{if {$node.image_height} > 0} height="{$node.image_height}"{/if} />/foreach} но так тоже не получается Link to post Share on other sites
support 447 Posted August 13, 2018 Report Share Posted August 13, 2018 Нет, не так. Просто внутрь скопировать картинку, не удаляя скобки. Вот так: {foreach from=$content_list item=node} <li{if $node.alias == $content_alias} class="active"{/if}><a href="{$node.url}">{$node.name}</a></li> <a href="{$node.url}" class="image"><img src="{$node.image}" alt="{$node.name}"{if {$node.image_width} > 0} width="{$node.image_width}"{/if}{if {$node.image_height} > 0} height="{$node.image_height}"{/if} /> {/foreach} Link to post Share on other sites
mavince 0 Posted August 13, 2018 Author Report Share Posted August 13, 2018 Спасибо! Link to post Share on other sites
support 447 Posted August 13, 2018 Report Share Posted August 13, 2018 2 часа назад, mavince сказал: Спасибо! Не за что Link to post Share on other sites
Recommended Posts