-
AuthorPosts
-
September 19, 2022 at 1:21 pm #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
September 20, 2022 at 8:13 am #1365639Hi 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,
NikkoSeptember 20, 2022 at 11:57 am #1365680hm – 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 ***/
September 20, 2022 at 12:43 pm #1365692Hi Guenni007,
I see, thanks for sharing your solution :)
Best regards,
NikkoSeptember 20, 2022 at 2:02 pm #1365702and 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/
September 26, 2022 at 12:50 pm #1366352Thanks 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: autoDid we do anything wrong?
Thanks for your help
KorinnaSeptember 26, 2022 at 3:08 pm #1366376Hi
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,
YigitSeptember 26, 2022 at 8:48 pm #1366454soweit 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.
September 26, 2022 at 9:29 pm #1366457so – 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.September 27, 2022 at 1:02 pm #1366537schö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; }
September 27, 2022 at 1:20 pm #1366541next 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; }
September 28, 2022 at 12:09 pm #1366692This reply has been marked as private.September 28, 2022 at 12:11 pm #1366693Super, recht vielen Dank an Dich :-)
September 28, 2022 at 6:29 pm #1366768Hi,
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 -
AuthorPosts
- The topic ‘searchfield in menu’ is closed to new replies.