Fork me on GitHub

Language switch, login/logout in theme header  Bottom

  • hello all.
    I need to put language switch output and login logout/profile link in the header menu.
    As i guess i need to write plugin scripts to get variables and write output.
    can you give me advice or examples what functions i need and how?
    p.s.
    I checked "BlankTheme" and login/logout link is done in complicated way (as part of Menu array ..i don't get it how)
  • You like that BlankTheme method icon_razz

    Anyway, you can find some of the plugins available in the system/Themes/plugins/

    I cannot comment on the multi-language stuff. But there is a block available, so you could look at that for a hint.

    --
    David Pahl
    Zikula Support Team
  • hi,
    there is a plugin (system/pnRender/plugins/function.html_select_languages.php):

    Code

    <!--[html_select_languages name=language selected=eng]-->
  • AmmoDump

    You like that BlankTheme method icon_razz


    yeps ;)
    i used this kind of theme (i mean "smart buttons" i neader menu) in 0.7 versions of postnuke..but that themes are old and use theme.php to write out whole page..so no pnRender compliance :)

    philipp2

    hi,
    there is a plugin (system/pnRender/plugins/function.html_select_languages.php):

    Code

    <!--[html_select_languages name=language selected=eng]-->

    thanks , No that doesn not help it onlyshows language list and doesnot change current language



    edited by: shoshia, Dec 05, 2008 - 10:23 AM
  • shoshia

    I checked "BlankTheme" and login/logout link is done in complicated way (as part of Menu array ..i don't get it how)

    No! BlankTheme uses the 'userlinks' system plugin.
    That's different of the 'bt_userlinks' plugin in charge of the default menu.
    I haven't noted that similarity before icon_razz

    So, if you want to code a plugin for both things at the same time check the code of:

    * The switch language block:
    /system/Blocks/pnblocks/thelang.php and it's template:
    /system/Blocks/pntemplates/blocks_block_thelang.htm

    * The userlinks system plugin:
    /system/Theme/plugins/function.userlinks.php

    And merge both functionalities as you want icon_wink

    --
    - Mateo T. -
    Mis principios... son mis fines
  • ok..i did something, but encountered CSS-ing problem.

    see http://shoshia.byteact.com

    i can not get away from that bullet.
    also bullet appears in different places in IE and firefox.
    Part of CSS file content(i put "list-style-type: none;" in most places ):

    Code

    /* CSS Document */

    html {
        height: 100%;
    }

    body {
        height: 100%;
        margin-bottom: 1px;
    }

    img {
    border:0px;
    }
    .clr {
        clear: both;
    }

    .outline {
      border: 1px solid #cccccc;
      background: #ffffff;
        padding: 2px;
    }

    .invisible {
        display: none;
    }

    #buttons_outer {
        width: 635px;
        margin-bottom: 2px;
        margin-right: 2px;
        float: left;

    }

    #buttons_inner {
        border: 1px solid #cccccc;
        height: 21px !important;
        height: 23px;
    }


    #buttons {
        float: left;
        margin: 0px;
        padding: 0px;
        width: auto;
        list-style-type: none;

    }


    ul#mainlevel-nav
    {
        list-style: none;
        padding: 0;
        margin: 0;
        font-size: 0.8em;
        list-style-type: none;
    }

    ul#mainlevel-nav li
    {
        background-image: none;
        padding-left: 0px;
        padding-right: 0px;
        float: left;
        margin: 0;
        font-size: 11px;
        line-height: 21px;
        white-space: nowrap;
        border-right: 1px solid #cccccc;
        list-style-type: none;
    }

    ul#mainlevel-nav li a
    {
        display: block;
        padding-left: 15px;
        padding-right: 15px;
        text-decoration: none;
        color: #333333;
        background: transparent;
        list-style:none;
        list-style-type: none;
        list-style: none;
       

    }
    ul#mainlevel-nav li a
    {
        display: block;
        padding-left: 15px;
        padding-right: 15px;
        text-decoration: none;
        color: #333333;
        background: transparent;
        list-style:none;
        list-style-type: none;
        list-style: none;
       
    }
    #buttons>ul#mainlevel-nav li a { width: auto; }

        ul#mainlevel-nav li a:hover
    {
        color: #fff;
        background: #c64934;
        list-style:none;
        list-style-type: none;
        list-style: none;
       

    }





    #header {
        float: left;
        padding: 0px;
        margin-right: 1px;
        width: 800px;
        height: 0px;
        background: url(../images/header_short.gif) no-repeat;
    }

    and template file...this is a part of code

    Code

    <div id="header">
             </div>

              <div id="buttons_outer">

                <div id="buttons_inner">



                <div id="buttons">

                <ul id="mainlevel-nav"><li><a href="index.php" class="mainlevel-nav" >Home</a></li>
                <li><a href="index.php" class="mainlevel-nav" >Contact Us</a></li>
                <li><a href="index.php" class="mainlevel-nav" >News</a></li>
                <li><a href="index.php" class="mainlevel-nav" >Links</a></li>
                <!--[if pnuserloggedin($loggedin) eq 1]-->
                 <li>  
                <a href="index.php?module=Users&func=logout" class="mainlevel-nav" color="Red">LogOut</a></li>
                </li>
                <li>
                <a href="index.php?module=Profile" class="mainlevel-nav" color="Red">Profile</a></li>
                </li>
                <!--[/if]-->
     
    </ul>    

    </div>
       
        <div  id="buttons_inner" align= "right" align="-moz-right">
     <ul class="mainlevel-nav" >
               
    <li
                <a href="index.php?newlang=eng" >
    <img  src="http://shoshia.byteact.com/images/flags/flag-eng.png"></a>
       
        <a href="index.php?newlang=kat"  ><img  src="http://shoshia.byteact.com/images/flags/flag-kat.png"></a>
     
       </li>          
               
    </ul>    

    </div>      
              </div>

              </div>

              <div id="search_outer">

                <div id="search_inner">

               

    <form action="index.php?option=com_search&amp;Itemid=5" method="get">

      <div class="search">

        <input name="searchword" id="mod_search_searchword" maxlength="20" alt="search" class="inputbox" type="text" size="20" value="search..."  onblur="if(this.value=='') this.value='search...';" onfocus="if(this.value=='search...') this.value='';" />  </div>



      <input type="hidden" name="option" value="com_search" />



      <input type="hidden" name="Itemid" value="5" />  

    </form>            </div>

              </div>


    any hint for this?
  • fixed..just removed list and leave only div with images..everything works now ...
    thank everyone for helping...

    but still don't get why this bullet appears with flags



    edited by: shoshia, Dec 06, 2008 - 09:24 AM

This list is based on users active over the last 60 minutes.