Move the "Sign up now!" button to the header

PVS

Super Moderator
Thành viên BQT
Code hoặc hướng dẫn này được sử dụng trên phiên bản Xenforo cũ đã quá hạn sử dụng. Bạn hãy click để tìm bản mới hơn
Vnxf.vn - This template modification will allow you to move the "Sign up now!" button to the header:

Screenshot_1.png

Firstly it is necessary to increase the height of the header to put the button. To do this go to "Style Properties", "Header and Navigation" and in "Height of Header Logo" put 60px instead of 50px.

Now go to the templates of your style and search for "ad_header". Replace its content with this:
Mã:
<xen:hook name="ad_header" />

<xen:if is="!{$visitor.user_id}">

<div class="loginButton">
        <label for="LoginControl" id="SignupButton"><a href="{xen:link login}" class="inner">{xen:if $xenOptions.registrationSetup.enabled, {xen:phrase sign_up_now}, {xen:phrase log_in}}</a></label>
</div>

</xen:if>

After doing this search for "EXTRA.css" and add this:
Mã:
#header #SignupButton
{
    float: right;
    margin: 10px 0;
    width: 165px;
}

.sidebar .loginButton
{
    display: none;
}

<xen:if is="@enableResponsive">
@media (max-width:@maxResponsiveMediumWidth)
{
    .Responsive #loginBarHandle
    {
        display: inherit;
    }

    .Responsive #header #SignupButton
    {
        display: none;
    }

    .Responsive .sidebar .loginButton
    {
        display: inherit;
    }
}
</xen:if>

This will allow to make the button of the header like the button of the sidebar, but also make the responsiveness perfect.

Video preview: http://screencast.com/t/o3pTujcQCnDM


Nguồn: xenforo.com​
 
  • Like
Reactions: THB
Back
Top