XF 2.2 Как переместить информацию в главную карточку.

Версия XenForo
2.2.8

abobus

Проверенные
Сообщения
20
Реакции
0
Баллы
58
Здравствуйте, хотел бы узнать как переместить данную информацию:
1651666600710.png

Вот сюда:
1651666613463.png

Пример:
1651666650178.png
 
Решение
Модификацией шаблона member_view admin.php?template-modifications/add
Шаблон: member_view
Ключ: add_customField_memberHeader

Найти:
HTML:
                                <xf:if contentcheck="true">
                                    <div class="memberHeader-blurb">
                                        <dl class="pairs pairs--inline">
                                            <dt>{{ phrase('last_seen') }}</dt>
                                            <dd dir="auto">
                                                <xf:contentcheck><xf:useractivity user="$user" class="pairs--plainLabel" /></xf:contentcheck>
                                            </dd>
                                        </dl>...
Модификацией шаблона member_view admin.php?template-modifications/add
Шаблон: member_view
Ключ: add_customField_memberHeader

Найти:
HTML:
                                <xf:if contentcheck="true">
                                    <div class="memberHeader-blurb">
                                        <dl class="pairs pairs--inline">
                                            <dt>{{ phrase('last_seen') }}</dt>
                                            <dd dir="auto">
                                                <xf:contentcheck><xf:useractivity user="$user" class="pairs--plainLabel" /></xf:contentcheck>
                                            </dd>
                                        </dl>
                                    </div>
                                </xf:if>

Заменить:
HTML:
$0
            <xf:if contentcheck="true">
                <xf:contentcheck>
                    <xf:if contentcheck="true">
                        <dl class="pairs pairs--columns pairs--fixedSmall">
                            <dt>{{ phrase('birthday') }}</dt>
                            <dd>
                                <xf:contentcheck>
                                    <xf:if is="$user.Profile.birthday.timeStamp">
                                        {{ date($user.Profile.birthday.timeStamp, $user.Profile.birthday.format) }}
                                        <xf:if is="$user.Profile.birthday.age">
                                            {{ parens(phrase('age:') . ' ' . {$user.Profile.birthday.age}) }}
                                        </xf:if>
                                    </xf:if>
                                </xf:contentcheck>
                            </dd>
                        </dl>
                    </xf:if>

                    <xf:if is="$user.Profile.website">
                        <dl class="pairs pairs--columns pairs--fixedSmall">
                            <dt>{{ phrase('website') }}</dt>
                            <dd>
                                <a href="{$user.Profile.website}" rel="nofollow" target="_blank">{$user.Profile.website}</a>
                            </dd>
                        </dl>
                    </xf:if>

                    <xf:if is="$user.Profile.location">
                        <dl class="pairs pairs--columns pairs--fixedSmall">
                            <dt>{{ phrase('location') }}</dt>
                            <dd>
                                <xf:if is="$xf.options.geoLocationUrl">
                                    <a href="{{ link('misc/location-info', '', {'location': $user.Profile.location}) }}" rel="nofollow noreferrer" target="_blank" class="u-concealed">{$user.Profile.location}</a>
                                <xf:else />
                                    {$user.Profile.location}
                                </xf:if>
                            </dd>
                        </dl>
                    </xf:if>

                    <xf:macro template="custom_fields_macros" name="custom_fields_view"
                        arg-type="users"
                        arg-group="personal"
                        arg-set="{$user.Profile.custom_fields}"
                        arg-additionalFilters="{{ ['profile'] }}" />
                 
                                                <xf:macro template="custom_fields_macros" name="custom_fields_view"
                                arg-type="users"
                                arg-group="contact"
                                arg-set="{$user.Profile.custom_fields}"
                                arg-additionalFilters="{{ ['profile'] }}" />
                </xf:contentcheck>
            </xf:if>

Копировать код кнопкой справа сверху.

Выходит примерно так:
1651671908165.png

css:

Код:
.memberHeader-content
{
    .pairs--fixedSmall
    {
        &
        {
            margin-top: 3px;
        }

        dt
        {
            width: min-content !important;
        }
    }
}
 
Последнее редактирование:
Модификацией шаблона member_view admin.php?template-modifications/add
Шаблон: member_view
Ключ: add_customField_memberHeader

Найти:
HTML:
                                <xf:if contentcheck="true">
                                    <div class="memberHeader-blurb">
                                        <dl class="pairs pairs--inline">
                                            <dt>{{ phrase('last_seen') }}</dt>
                                            <dd dir="auto">
                                                <xf:contentcheck><xf:useractivity user="$user" class="pairs--plainLabel" /></xf:contentcheck>
                                            </dd>
                                        </dl>
                                    </div>
                                </xf:if>

Заменить:
HTML:
$0
            <xf:if contentcheck="true">
                <xf:contentcheck>
                    <xf:if contentcheck="true">
                        <dl class="pairs pairs--columns pairs--fixedSmall">
                            <dt>{{ phrase('birthday') }}</dt>
                            <dd>
                                <xf:contentcheck>
                                    <xf:if is="$user.Profile.birthday.timeStamp">
                                        {{ date($user.Profile.birthday.timeStamp, $user.Profile.birthday.format) }}
                                        <xf:if is="$user.Profile.birthday.age">
                                            {{ parens(phrase('age:') . ' ' . {$user.Profile.birthday.age}) }}
                                        </xf:if>
                                    </xf:if>
                                </xf:contentcheck>
                            </dd>
                        </dl>
                    </xf:if>

                    <xf:if is="$user.Profile.website">
                        <dl class="pairs pairs--columns pairs--fixedSmall">
                            <dt>{{ phrase('website') }}</dt>
                            <dd>
                                <a href="{$user.Profile.website}" rel="nofollow" target="_blank">{$user.Profile.website}</a>
                            </dd>
                        </dl>
                    </xf:if>

                    <xf:if is="$user.Profile.location">
                        <dl class="pairs pairs--columns pairs--fixedSmall">
                            <dt>{{ phrase('location') }}</dt>
                            <dd>
                                <xf:if is="$xf.options.geoLocationUrl">
                                    <a href="{{ link('misc/location-info', '', {'location': $user.Profile.location}) }}" rel="nofollow noreferrer" target="_blank" class="u-concealed">{$user.Profile.location}</a>
                                <xf:else />
                                    {$user.Profile.location}
                                </xf:if>
                            </dd>
                        </dl>
                    </xf:if>

                    <xf:macro template="custom_fields_macros" name="custom_fields_view"
                        arg-type="users"
                        arg-group="personal"
                        arg-set="{$user.Profile.custom_fields}"
                        arg-additionalFilters="{{ ['profile'] }}" />
                
                                                <xf:macro template="custom_fields_macros" name="custom_fields_view"
                                arg-type="users"
                                arg-group="contact"
                                arg-set="{$user.Profile.custom_fields}"
                                arg-additionalFilters="{{ ['profile'] }}" />
                </xf:contentcheck>
            </xf:if>

Копировать код кнопкой справа сверху.

Выходит примерно так:
Посмотреть вложение 137956

css:

Код:
.memberHeader-content
{
    .pairs--fixedSmall
    {
        &
        {
            margin-top: 3px;
        }

        dt
        {
            width: min-content !important;
        }
    }
}

Возможно я тупой, но у меня 0 применений. С чем может быть связанно?
1651676171599.png
 
Зайдите в шаблон member_view
Копируете код так, как я сделал(выделение от и до)
1651677068383.png

Копируем это и вставляем уже в созданную модификацию
Там где найти удаляете то, что уже вставили и вставляете то, что скопировали снова.

p.s если мой ответ сработал, то выделите его решением(справа от сообщения).
 
Последнее редактирование:
Современный облачный хостинг провайдер | Aéza
Назад
Сверху Снизу