Creating select menu navigation

Guido

Avatar: Guido

2012-09-02 20:17

Hi,

I like to have a select menu bar and found this code:

----
<form action="../">
<select onchange="window.open(this.options[this.selectedIndex].value,'_top')">
<option value="/">Home</option>
<option value="/?nl_,2">page 2</option>
<option value="/?nl_,3">page 3</option>
<option value="/?nl_,4">page 4</option>
<option value="/?nl_,5">page 5</option>
</select>
----

It's working, but as you can see I've added all menu-items manually.

Is it possible to add (for example) #menu2 without adding all menu-items from this menu?

» Quick.Cms v4.x

selekcjoner

Avatar: selekcjoner

2012-09-02 22:52

1) Edit default.php:
Find code:

 $sMenu2 $oPage->throwMenu'menus.tpl'2$iContent, ( $config['display_dropdown_menu'] === ) ? );


Replace to:

   $sMenu2 $oPage->throwMenu'menus-select.tpl'2$iContent);



2) Create menus-select.tpl and add to the folder with the template:

<!-- BEGIN PAGES -->
<
select onchange="window.open(this.options[this.selectedIndex].value,'_top')"
<
div id="menu$aData[iType]">
<
option value="">$aData[sMenuType]</option
  <
ul>
  <!-- 
START LIST -->
 <
li class="l$aData[sStyle]<!-- IF:START SELECTED --> selected<!-- IF:END SELECTED -->">

      <
option value="$aData[sLinkName]">$aData[sName]</option>
      
$aData[sSubContent]
    </
li>
  <!-- 
END LIST -->
  </
ul>
</
div></select
<!-- 
END PAGES -->

<!-- 
HEAD_SUB and FOOT_SUB it is only header and footer of subpgages list
Subpages content are listing from block PAGES from LIST sub-block 
-->

<!-- 
BEGIN HEAD_SUB -->
  <
ul class="sub$aData[iDepth]">
<!-- 
END HEAD_SUB -->
<!-- 
BEGIN FOOT_SUB -->
  </
ul>
<!-- 
END FOOT_SUB -->

simlution.org

Guido

Avatar: Guido

2012-09-03 14:20

Thanks, I will try this code tonight :-).

Is it possible to use select-menu only for mobile function?

Normal pc > default menu
Mobile device > select menu

Guido

Back to top
about us | contact