Иконка ресурса

Отделяем важные темы от обычных

SkyLoKi

Проверенные
Сообщения
259
Решения
2
Реакции
916
Баллы
11,175
Пользователь SkyLoKi разместил новый ресурс:

Отделяем важные темы от обычных - Отделяем важные темы от обычных

Посмотреть вложение 74707

В шаблоне forum_view находим:
Код:
<xf:if is="$stickyThreads is not empty OR $threads is not empty">
                <div class="structItemContainer">
                    <xf:if is="$stickyThreads is not empty">
                        <div class="structItemContainer-group structItemContainer-group--sticky">
                            <xf:foreach loop="$stickyThreads" value="$thread">...

Узнать больше об этом ресурсе...
 
Кого? :O_o:
 
Изменения в шаблонах
 
Еще один вариант тогда, без правки шаблонов: (и в проще)

В extra.less вставить:

Код:
.structItemContainer-group{
    &--sticky{
            background-image:-o-linear-gradient(#F8FCEB, #DCF0C0 60%  );
        background-image: -moz-linear-gradient(top, #F3FAE1, #DCF0C0);
        background-image: -webkit-gradient(linear,left bottom,left top,color-stop(0, #DCF0C0),color-stop(1, #F3FAE1));
        filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#DCF0C0');
    }
}

Получится вот такое:
2017-09-11_092958.jpg
 
Последнее редактирование:
На самом деле всё куда проще и вариант универсальный.

CSS:
Код:
.structItemContainer-group--sticky {
    background-color: #f7caca;
    border: 1px solid #d88585;
}


LESS:
Код:
.structItemContainer-group--sticky {
    @color-1: #f7caca;
    @color-2: #d88585;
    @the-border: 1px solid;
    background-color: @color-1;
    border: @the-border @color-2;
}

Бордер вообще можно нафиг убрать.

Итог:
ilfzw.png
 
LESS:
Код:
.structItemContainer-group--sticky {
    @color-1: #f7caca;
    @color-2: #d88585;
    @the-border: 1px solid;
    background-color: @color-1;
    border: @the-border @color-2;
}
Этого же достаточно?Просто ты 2 варианта написал, какой из них лучше
 
Без разницы какой вариант использовать, но всё-таки мы вставляем код в шаблон в расширением .less, поэтому я бы заюзал именно less вариант. :)
 
Код:
<div class="block-body">
            <div class="structItemContainer">
                <xf:macro template="thread_list_macros" name="quick_thread"
                    arg-forum="{$forum}"
                    arg-page="{$page}"
                    arg-order="{$sortInfo.order}"
                    arg-direction="{$sortInfo.direction}" />
                <xf:if is="$stickyThreads is not empty OR $threads is not empty">
                    <xf:if is="$stickyThreads is not empty">
                        <div class="structItemContainer-group structItemContainer-group--sticky">
                            <xf:foreach loop="$stickyThreads" value="$thread">
                                <xf:macro template="thread_list_macros" name="item" arg-thread="{$thread}" arg-forum="{$forum}" />
                            </xf:foreach>
                        </div>

                        <xf:ad position="forum_view_below_stickies" arg-forum="{$forum}" />
                    </xf:if>

                    <xf:if is="$threads is not empty">
                        <div class="structItemContainer-group js-threadList">
                            <xf:foreach loop="$threads" value="$thread">
                                <xf:macro template="thread_list_macros" name="item" arg-thread="{$thread}" arg-forum="{$forum}" />
                            </xf:foreach>
                        </div>
                    </xf:if>
                <xf:elseif is="$filters" />
                    <div class="structItem js-emptyThreadList">
                        <div class="structItem-cell">{{ phrase('there_no_threads_matching_your_filters') }}</div>
                    </div>
                <xf:else />
                    <div class="structItem js-emptyThreadList">
                        <div class="structItem-cell">{{ phrase('there_no_threads_in_this_forum') }}</div>
                    </div>
                </xf:if>
            </div>
        </div>
    </div>


почему то я не могу найти код как на 1 сообщение у меня он другой
подскажите что делать ?
 
Та не парьтесь Вы с правкой шаблона... Там ещё несколько вариантов для extra.less имеется.
 
Можно сделать просто без правки шаблона.
Вставить в extra.less
Код:
/* Важные темы l*/
.structItemContainer {
.structItemContainer-group.structItemContainer-group--sticky {
margin: 0px 0px 4px 0px;
    border-bottom: 1px solid #cbcbcb;
    background: linear-gradient(0deg, #edf6fd, #f6fafe);
    padding: 6px 10px;
    font-size: 13px;
    color: #2577b1;
}
.structItemContainer-group.structItemContainer-group--sticky:before {
    .m-faContent("@{fa-var-exclamation-triangle}\ Важные темы");
    font-family: 'Font Awesome 5 Pro';
}

.structItemContainer-group.js-threadList:before {
    .m-faContent("@{fa-var-info-circle}\ Обычные темы");
    font-family: 'Font Awesome 5 Pro';
    margin: 0 0 0 8px;
    color: #2577b1;
}
}
/* Важные темы l*/
 
phost, и отломать во всем движке structItem’ы. Ну хватит использовать общие классы, добавляйте что-то более специфическое повыше, дабы не затрагивать лишнее.
 
Современный облачный хостинг провайдер | Aéza
Назад
Сверху Снизу