1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Positioning Language Chooser Problem

Discussion in 'XenForo Questions and Support' started by bogus, Jan 22, 2011.

  1. bogus

    bogus Guest

    I wanted to move the Language Chooser into the Navbar, but as soon as i take it out of the footer and try to add it into the Navbar, the phrase "Language" is visible and i cant figure out why

    Thats how it looks at the moment (Color will be changed later)
    Unbenannt.jpg

    Here is the Code of the navigation Template - Starts at <!-- Chooser: start -->

    PHP:
    <xen:edithint template="navigation.css" />

    <
    div id="navigation" class="pageWidth">
        <
    div class="pageContent">
     
            <
    nav>

    <
    div class="navTabs">

        <
    ul class="publicTabs">

            <!-- 
    home -->
            <
    xen:if is="{$showHomeLink}">
                <
    li class="navTab home PopupClosed"><a href="{$homeLink}class="navLink">{xen:phrase home}</a></li>
            </
    xen:if>

            <!-- 
    extra tabshome -->
            <
    xen:if is="{$extraTabs.home}">
            <
    xen:foreach loop="$extraTabs.home" key="$extraTabIdvalue="$extraTab">
                <
    xen:if is="{$extraTab.linksTemplate}">
                    <
    li class="navTab {$extraTabId} {xen:if $extraTab.selected, 'selected', 'Popup PopupControl PopupClosed'}">

                    <
    a href="{$extraTab.href}class="navLink">{$extraTab.title}</a>
                    <
    a href="{$extraTab.href}class="SplitCtrl" rel="Menu"></a>

                    <
    div class="{xen:if {$extraTab.selected}, 'tabLinks', 'Menu JsOnly tabMenu'}">
                        <
    div class="primaryContent menuHeader">
                            <
    h3>{$extraTab.title}</h3>
                            <
    div class="muted">{xen:phrase quick_links}</div>
                        </
    div>
                        {
    xen:raw $extraTab.linksTemplate}
                    </
    div>
                </
    li>
                <
    xen:else />
                    <
    li class="navTab {xen:if $extraTab.selected, 'selected', 'PopupClosed'}">
                        <
    a href="{$extraTab.href}class="navLink">{$extraTab.title}</a>
                        <
    xen:if is="{$extraTab.selected}"><div class="tabLinks"></div></xen:if>
                    </
    li>
                </
    xen:if>
            </
    xen:foreach>
            </
    xen:if>
     
            <!-- 
    forums -->
            <
    xen:if is="{$tabs.forums}">
                <
    li class="navTab forums {xen:if $tabs.forums.selected, 'selected', 'Popup PopupControl PopupClosed'}">

                    <
    a href="{$tabs.forums.href}class="navLink">{$tabs.forums.title}</a>
                    <
    a href="{$tabs.forums.href}class="SplitCtrl" rel="Menu"></a>

                    <
    div class="{xen:if {$tabs.forums.selected}, 'tabLinks', 'Menu JsOnly tabMenu'}">
                        <
    div class="primaryContent menuHeader">
                            <
    h3>{$tabs.forums.title}</h3>
                            <
    div class="muted">{xen:phrase quick_links}</div>
                        </
    div>
                        <
    ul class="secondaryContent blockLinksList">
                            <
    xen:if is="{$visitor.user_id}"><li><a href="{xen:link 'forums/-/mark-read', '', 'date={$serverTime}'}" class="OverlayTrigger">{xen:phrase mark_all_forums_read}</a></li></xen:if>
                            <
    xen:if is="{$canSearch}"><li><a href="{xen:link search, '', 'type=post'}">{xen:phrase search_forums}</a></li></xen:if>
                            <
    xen:if is="{$visitor.user_id}"><li><a href="{xen:link 'watched/threads'}">{xen:phrase watched_threads}</a></li></xen:if>
                            <
    li><a href="{xen:link 'find-new/threads'}">{xen:phrase whats_new}</a></li>
                        </
    ul>
                    </
    div>
                </
    li>
            </
    xen:if>
     
            <!-- 
    extra tabsmiddle -->
            <
    xen:if is="{$extraTabs.middle}">
            <
    xen:foreach loop="$extraTabs.middle" key="$extraTabIdvalue="$extraTab">
                <
    xen:if is="{$extraTab.linksTemplate}">
                    <
    li class="navTab {$extraTabId} {xen:if $extraTab.selected, 'selected', 'Popup PopupControl PopupClosed'}">

                    <
    a href="{$extraTab.href}class="navLink">{$extraTab.title}</a>
                    <
    a href="{$extraTab.href}class="SplitCtrl" rel="Menu"></a>

                    <
    div class="{xen:if {$extraTab.selected}, 'tabLinks', 'Menu JsOnly tabMenu'}">
                        <
    div class="primaryContent menuHeader">
                            <
    h3>{$extraTab.title}</h3>
                            <
    div class="muted">{xen:phrase quick_links}</div>
                        </
    div>
                        {
    xen:raw $extraTab.linksTemplate}
                    </
    div>
                </
    li>
                <
    xen:else />
                    <
    li class="navTab {xen:if $extraTab.selected, 'selected', 'PopupClosed'}">
                        <
    a href="{$extraTab.href}class="navLink">{$extraTab.title}</a>
                        <
    xen:if is="{$extraTab.selected}"><div class="tabLinks"></div></xen:if>
                    </
    li>
                </
    xen:if>
            </
    xen:foreach>
            </
    xen:if>
     
            <!-- 
    members -->
            <
    xen:if is="{$tabs.members}">
                <
    li class="navTab members {xen:if $tabs.members.selected, 'selected', 'Popup PopupControl PopupClosed'}">

                    <
    a href="{$tabs.members.href}class="navLink">{$tabs.members.title}</a>
                    <
    a href="{$tabs.members.href}class="SplitCtrl" rel="Menu"></a>

                    <
    div class="{xen:if {$tabs.members.selected}, 'tabLinks', 'Menu JsOnly tabMenu'}">
                        <
    div class="primaryContent menuHeader">
                            <
    h3>{$tabs.members.title}</h3>
                            <
    div class="muted">{xen:phrase quick_links}</div>
                        </
    div>
                        <
    ul class="secondaryContent blockLinksList">
                            <
    li><a href="{xen:link members}">{xen:phrase registered_members}</a></li>
                            <
    li><a href="{xen:link online}">{xen:phrase current_visitors}</a></li>
                            <
    li><a href="{xen:link recent-activity}">{xen:phrase recent_activity}</a></li>
                        </
    ul>
                    </
    div>
                </
    li>
            </
    xen:if>

            <!-- 
    help -->
            <
    xen:if is="{$tabs.help}">
                <
    li class="navTab help {xen:if $tabs.help.selected, 'selected', 'Popup PopupControl PopupClosed'}">

                    <
    a href="{$tabs.help.href}class="navLink" rel="help">{$tabs.help.title}</a>
                    <
    a href="{$tabs.help.href}class="SplitCtrl" rel="Menu"></a>

                    <
    div class="{xen:if {$tabs.help.selected}, 'tabLinks', 'Menu JsOnly tabMenu'}">
                        <
    div class="primaryContent menuHeader">
                            <
    h3>{$tabs.help.title}</h3>
                            <
    div class="muted">{xen:phrase quick_links}</div>
                        </
    div>
                        <
    ul class="secondaryContent blockLinksList">
                            <
    li><a href="{xen:link help/smilies}">{xen:phrase smilies}</a></li>
                            <
    li><a href="{xen:link help/bb-codes}">{xen:phrase bb_codes}</a></li>
                            <
    li><a href="{xen:link help/trophies}">{xen:phrase trophies}</a></li>
                        </
    ul>
                    </
    div>
                </
    li>
            </
    xen:if>

            <!-- 
    Chooserstart -->
                <
    div class="navTab">
                <
    xen:if is="{$canChangeLanguage}">
                <
    dl class="choosers">
                    <
    xen:if is="{$canChangeLanguage}">
                        <
    dt>{xen:phrase language}</dt>
                        <
    dd><a href="{xen:link 'misc/language', '', 'redirect={$requestPaths.requestUri}'}" class="OverlayTrigger Tooltip" title="{xen:phrase language_chooser}" data-offsetY="-11">{$visitorLanguage.title}</a></dd>
                    </
    xen:if>
                </
    dl>
                </
    xen:if>
                </
    div>
            <!-- 
    Chooserend -->

            <!-- 
    extra tabsend -->
            <
    xen:if is="{$extraTabs.end}">
            <
    xen:foreach loop="$extraTabs.end" key="$extraTabIdvalue="$extraTab">
                <
    xen:if is="{$extraTab.linksTemplate}">
                    <
    li class="navTab {$extraTabId} {xen:if $extraTab.selected, 'selected', 'Popup PopupControl PopupClosed'}">

                    <
    a href="{$extraTab.href}class="navLink">{$extraTab.title}</a>
                    <
    a href="{$extraTab.href}class="SplitCtrl" rel="Menu"></a>

                    <
    div class="{xen:if {$extraTab.selected}, 'tabLinks', 'Menu JsOnly tabMenu'}">
                        <
    div class="primaryContent menuHeader">
                            <
    h3>{$extraTab.title}</h3>
                            <
    div class="muted">{xen:phrase quick_links}</div>
                        </
    div>
                        {
    xen:raw $extraTab.linksTemplate}
                    </
    div>
                </
    li>
                <
    xen:else />
                    <
    li class="navTab {xen:if $extraTab.selected, 'selected', 'PopupClosed'}">
                        <
    a href="{$extraTab.href}class="navLink">{$extraTab.title}</a>
                        <
    xen:if is="{$extraTab.selected}"><div class="tabLinks"></div></xen:if>
                    </
    li>
                </
    xen:if>
            </
    xen:foreach>
            </
    xen:if>
     
            <!-- 
    no selection -->
            <
    xen:if is="!{$selectedTab}">
                <
    li class="navTab selected"><div class="tabLinks"></div></li>
            </
    xen:if>
      
        </
    ul>

        <
    xen:if is="{$visitor.user_id}"><xen:include template="navigation_visitor_tab" /></xen:if>
    </
    div>

    <
    span class="helper"></span>

            </
    nav>
        </
    div>
    </
    div>
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Try changing the dd/dt code to li to match the other tabs.
     
  3. bogus

    bogus Guest

    Thanks. another Question. Do i need {xen:phrase language}?
    I mean, does it have any function? Or can i also delete it?
     
  4. Floris

    Floris Guest

    nope, you can just use english :)
     
  5. James

    James Well-Known Member

    I only ever rely completely on phrases when I'm distributing a style... that way people can easily change all occurrences of that phrase by changing the phrase.

    You could delete it and just put "Language", however.
     
  6. bogus

    bogus Guest

    Ok ;) thanks. Well, i´ve tried to add the language chooser into the header, with no success, because down in the footer its quit hard to find, especially if u dont use english only but have some who wants to translate the page into english, for example, they dont know what to do. The solution with the chooser isnt the best yet. It should be more "international"
     
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I played with this and got it working:

    Screen shot 2011-01-22 at 11.27.26 PM.png

    Screen shot 2011-01-22 at 11.24.53 PM.png

    Admin CP -> Appearance -> Templates -> navigation

    Add this code:

    Code:
    		<xen:if is="{$canChangeLanguage}">
    		<li class="navTab PopupClosed">
    		<dl class="choosers">
    			<dd><a href="{xen:link 'misc/language', '', 'redirect={$requestPaths.requestUri}'}" class="navLink OverlayTrigger Tooltip" title="{xen:phrase language_chooser}">{$visitorLanguage.title}</a></dd>
    		</dl>
    		</li>
    		</xen:if>
    
    Like so:

    Code:
    					</div>
    					<ul class="secondaryContent blockLinksList">
    						<li><a href="{xen:link help/smilies}">{xen:phrase smilies}</a></li>
    						<li><a href="{xen:link help/bb-codes}">{xen:phrase bb_codes}</a></li>
    						<li><a href="{xen:link help/trophies}">{xen:phrase trophies}</a></li>
    					</ul>
    				</div>
    			</li>
    		</xen:if>
    
    		<xen:if is="{$canChangeLanguage}">
    		<li class="navTab PopupClosed">
    		<dl class="choosers">
    			<dd><a href="{xen:link 'misc/language', '', 'redirect={$requestPaths.requestUri}'}" class="navLink OverlayTrigger Tooltip" title="{xen:phrase language_chooser}">{$visitorLanguage.title}</a></dd>
    		</dl>
    		</li>
    		</xen:if>
    		
    		<!-- extra tabs: end -->
    		<xen:if is="{$extraTabs.end}">
    		<xen:foreach loop="$extraTabs.end" key="$extraTabId" value="$extraTab">
    			<xen:if is="{$extraTab.linksTemplate}">
    				<li class="navTab {$extraTabId} {xen:if $extraTab.selected, 'selected', 'Popup PopupControl PopupClosed'}">
    			
    				<a href="{$extraTab.href}" class="navLink">{$extraTab.title}</a>
    				<a href="{$extraTab.href}" class="SplitCtrl" rel="Menu"></a>
    
     
    rafass and (deleted member) like this.
  8. bogus

    bogus Guest

    Jake, I have to thank you a lot. You have done me a big favor with that
     
  9. Jon W

    Jon W Well-Known Member

    Jake Bunce likes this.

Share This Page