Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1365536

    Hallo,
    ich möchte gern in Enfold Medical in der Menüleiste zum Aufrufen der Suche anstatt nur des Lupen-Symbols, direkt ein Suchfeld anzeigen, in dass man direkt ohne auf die Lupe zu klicken, den Suchbegriff eintippen kann.
    Ist das möglich? Wie?

    Id like to put a searchfield to the menu in Enfold Medical, not just a symbol.
    Is it possible? How?

    Korinna

    #1365639

    Hi Korinna,

    Please follow Guenni007’s recommendation on this thread: https://kriesi.at/support/topic/search-icon-on-left-menu/#post-1185825
    Then go to Enfold > General Styling > Quick CSS, and add this CSS code:

    #top .avia-menu-text #searchform div {
        display: block !important;
        opacity: 1 !important;
        right: auto !important;
        transform: translateY(100%);
    }

    Hope it helps.

    Best regards,
    Nikko

    #1365680

    hm – yes but this was meant for main-menu on left or right position.
    but i think there will be now a better solution – just a moment …

    put this in your child-theme functions.php:

    
    add_shortcode('avia_search', 'get_search_form');
    
    function avf_add_search( $items, $args ){
      if ($args->theme_location == 'avia'){
    	  $search = '<li id="menu-item-search" class="menu-item menu-search menu-item-top-level">';
    	  $search .= do_shortcode('[avia_search]');
    	  $search .= '</li>';
        $items =  $items . $search;
      }
      return $items;
    }
    add_filter( 'wp_nav_menu_items', 'avf_add_search', 10, 2 );

    and this to your child quick css:

    
    .av-main-nav-wrap > ul:first-of-type {
      display: inline-flex !important;
      height: 100%;
    }
    
    #menu-item-search {
      line-height: 30px;
      position: relative;
    }
    
    #menu-item-search #searchform {
      position: relative;
      top: 50%;
      transform: translateY(-50%);
      height: 40px;
      line-height: 40px;
    }
    
    #top #searchform > div:first-of-type {
      position: relative;
      max-width: 200px;
      opacity: 1 !important;
      display: block !important;
    }
    
    #menu-item-search #searchform #s {
      padding: 10px 40px 10px 5px;
      font-size: initial;
      background-color: rgba(255,255,255,0.85);   /*** if you like to have transparency ***/ 
    }
    
    #top #searchform .ajax_search_response {
      background-color: rgba(255,255,255,0.85);
      position: absolute;
      top: 45px;
      padding: 10px 0;
      width: 100%;
    }
    
    /******* if you got  transparency option ******/
    #header.header_color.av_header_transparency #avia-menu #menu-item-search #searchform #s {
      background-color: rgba(255,255,255,0.35);
      color: #FFF !important;
    }
    #header.header_color.av_header_transparency #avia-menu ::placeholder {
      color: #FFF !important;
    }
    /*** end of transparency header setting ***/
    
    #1365692

    Hi Guenni007,

    I see, thanks for sharing your solution :)

    Best regards,
    Nikko

    #1365702

    and by the way – if you like to have search input field on hamburger too – we can use that ID set above ( on hamburger the IDs will change to classes)

    you need this additional snippet just under the above inserted:

    function add_search_to_burger_menu(){
    ?>
    <script type="text/javascript">
    (function($) {
    	$('.av-burger-menu-main').one('click', function() {
    		var page = window.location.href;
    		var mobile = $('.menu-item-search');
    		var search = '<form action="'+page+'" method="get" class=""><div><input type="submit" value="" id="searchsubmit" class="button avia-font-entypo-fontello"><input type="text" id="s" name="s" value="" placeholder="Search"></div></form>';
    
    		setTimeout(function() {
    			if(mobile.find('form').length == 1) return;
    			mobile.html(search);
    		}, 500);
    	});
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'add_search_to_burger_menu');

    and a bit of additional css in quick css:

    #top #wrap_all #header #av-burger-menu-ul>li.av-active-burger-items.menu-item-search {
      padding: 15px 50px;
      position: relative !important;
    }
    
    #top #av-burger-menu-ul #searchsubmit {
      height: 45px;
    }
    
    #top #wrap_all #header #av-burger-menu-ul>li.av-active-burger-items.menu-item-search form {
      position: relative !important;
    }
    
    #av-burger-menu-ul .ajax_search_response {
      background-color: #efefef;
      border: 1px solid #ddd;
      padding-top: 20px;
    }
    
    #av-burger-menu-ul .ajax_search_response > a {
      padding: 10px 12px 20px !important
    }

    See Results on : https://enfold.webers-webdesign.de/

    #1366352

    Thanks a lot to both of you.
    we followed your instructions. Unfortuanly it dit not work out on our page. The search symbol just moved down a litte and the search field not showing up.

    https://vorschau40.pepsite.de
    Look at it with passwort: auto

    Did we do anything wrong?
    Thanks for your help
    Korinna

    #1366376

    Hi

    Could you please create temporary admin logins and post them here privately so we can look into it? Please post FTP logins as well in case theme editor is hidden on WP dashboard :)

    Best regards,
    Yigit

    #1366454

    soweit ich euch verstanden habe, wolltet ihr doch direkt das Sucheingabefeld im Menu? – und nicht die Lupe.
    Nun wäre es hilfreich gewesen, ihr hättet erwähnt, dass es sich um den Header mit logo top menü darunter handelt. Denn hier hat man eine ganz andere Headerstruktur vorliegen – respektive natürlich die Selektoren sind andere.

    Ich werde mir mal so einen Header jetzt setzen um zu sehen, welche Selektoren hier zu nehmen sind.

    _______________

    as far as I understood you, you wanted directly the search input field in the menu? – and not the magnifying glass.
    Now it would have been helpful, you would have mentioned that it is the header with logo top menu below. Because here you have a completely different header structure – respectively of course the selectors are different.

    I will set me times such a header now to see which selectors are to be taken here.

    #1366457

    so – zunächst – bitte nicht bei den Enfold Optionen unter “Main Menü” die Option : “Append Search Icon To Main Menu” auswählen. Das wäre dann nämlich die Lupe.

    Wie oben beschrieben das in die child-theme functions.php:

    add_shortcode('avia_search', 'get_search_form');
    
    function avf_add_search( $items, $args ){
      if ($args->theme_location == 'avia'){
    	  $search = '<li id="menu-item-search" class="menu-item menu-search menu-item-top-level">';
    	  $search .= do_shortcode('[avia_search]');
    	  $search .= '</li>';
        $items =  $items . $search;
      }
      return $items;
    }
    add_filter( 'wp_nav_menu_items', 'avf_add_search', 10, 2 );

    und das hier in das quick css:

    .av-main-nav-wrap > ul:first-of-type {
      display: inline-flex !important;
      height: 100%;
    }
    
    #menu-item-search {
      line-height: 30px;
      position: relative;
    }
    
    #menu-item-search #searchform {
      position: relative;
      top: 50%;
      transform: translateY(-50%);
      height: 40px;
      line-height: 40px;
    }
    
    #top #searchform > div:first-of-type {
      position: relative;
      max-width: 200px;
      opacity: 1 !important;
      display: block !important;
    }
    
    #menu-item-search #searchform #s {
      padding: 10px 40px 10px 5px;
      font-size: initial;
      background-color: rgba(255,255,255,0.85);   /*** if you like to have transparency ***/ 
    }
    
    #top #searchform .ajax_search_response {
      background-color: rgba(255,255,255,0.85);
      position: absolute;
      top: 45px;
      padding: 10px 0;
      width: 100%;
    }

    hier kannst du sogar alle Home Varianten durchgehen – passt immer ( unter Home ist das Dropdown )
    4 entspricht dann deiner Header Setzung.

    https://basis.webers-testseite.de/home4/

    #1366537

    schön – ich sehe es klapt ja. Nur solltest du die Einfärbung des Menüs entweder nur auf das normal menü beschränken – oder für das Hamburger Menü extra css einführen – momentan hast du weiße schrift auf weißem Grund.

    daher als Vorschlag entweder:

    .header_color .av-hamburger-inner, 
    .header_color .av-hamburger-inner::before, 
    .header_color .av-hamburger-inner::after {
      background-color: #FFF !important;
    }
    
    .html_av-overlay-side #top .av-burger-overlay-scroll {
      background: #4083bb;
    }
    
    .main_menu #av-burger-menu-ul li a {
    	color: #FFF !important;
    }

    oder:

    .main_menu #av-burger-menu-ul li a {
    	color: #0059a4 !important;
    }
    
    .header_color .av-hamburger-inner, 
    .header_color .av-hamburger-inner::before, 
    .header_color .av-hamburger-inner::after {
      background-color: #FFF !important;
    }
    #1366541

    next tip:
    wenn du im Hamburger Menü nur eines der Untermenüs zeitgleich angezeigt bekommen möchtest:

    das hier in die functions.php

    function only_one_submenu_open_on_burger(){
    ?>
    <script>
    window.addEventListener("DOMContentLoaded", function () { 
    	(function($) {
    	  $('body').on( 'click touch', '.av-active-burger-items > a', function () {
    	    $(this).parent('li').siblings().removeClass('av-show-submenu');
    	    $(this).parent('li').siblings().find('ul').slideUp( "fast");
    	  });
    	  $('body').on( 'click touch', '.av-active-burger-items .av-width-submenu > a', function () {
    	    $(this).closest('.sub-menu').siblings().find('li').removeClass('av-show-submenu');
    	    $(this).closest('.sub-menu').siblings().find('ul').slideUp( "fast");
    	  });
    	})(jQuery);
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'only_one_submenu_open_on_burger');

    in dem Zusammenhang ist eventuell besser wenn du das Menü nicht über die Höhe zentrierst.

    #top #av-burger-menu-ul {
      vertical-align: top;
      padding: 150px 0 !important;
    }
    #1366692
    This reply has been marked as private.
    #1366693

    Super, recht vielen Dank an Dich :-)

    #1366768

    Hi,
    Glad Guenni007 could help, thank you Guenni007, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘searchfield in menu’ is closed to new replies.