Header
Arama
Sitede genel arama yaptırdığınız alanın görünümü ve kod yapısı
Görünüm

Header Komponentleri
Kod Yapısı
HTML
index.html<div class="search"> <form action="{{ path('search') }}" data-selector="search-form"> <input type="text" name="q" placeholder="{{ theme.settings.search_placeholder }}" onfocus="this.placeholder = ''" onblur="this.placeholder = '{{ theme.settings.search_placeholder }}'" aria-label="Search" {% if theme.settings.use_search_auto_complete %}class="auto-complete"{% endif %}> <button> <svg width="36" height="36" viewBox="0 0 36 36" fill="none"> <path d="M26.5855 24.0867L22.4875 19.9888C23.3974 18.4692 23.7204 16.6695 23.3957 14.9283C23.0709 13.1872 22.1209 11.6249 20.7244 10.5355C19.3278 9.44616 17.5813 8.90492 15.8135 9.01372C14.0457 9.12251 12.3786 9.87384 11.1262 11.1262C9.87384 12.3786 9.12251 14.0457 9.01372 15.8135C8.90492 17.5813 9.44616 19.3278 10.5355 20.7244C11.6249 22.1209 13.1872 23.0709 14.9283 23.3957C16.6695 23.7204 18.4692 23.3974 19.9888 22.4875L24.0867 26.5855C24.2179 26.7169 24.3737 26.8211 24.5452 26.8923C24.7167 26.9634 24.9006 27 25.0862 27C25.2719 27 25.4558 26.9634 25.6273 26.8923C25.7988 26.8211 25.9546 26.7169 26.0857 26.5855L26.5855 26.0857C26.7169 25.9546 26.8211 25.7988 26.8923 25.6273C26.9634 25.4558 27 25.2719 27 25.0862C27 24.9006 26.9634 24.7167 26.8923 24.5452C26.8211 24.3737 26.7169 24.2179 26.5855 24.0867V24.0867ZM10.1317 16.2587C10.1317 15.0463 10.4912 13.8611 11.1648 12.853C11.8384 11.845 12.7957 11.0593 13.9158 10.5953C15.0359 10.1314 16.2685 10.01 17.4575 10.2465C18.6466 10.483 19.7389 11.0668 20.5962 11.9241C21.4535 12.7814 22.0373 13.8737 22.2738 15.0628C22.5103 16.2519 22.3889 17.4844 21.925 18.6045C21.461 19.7246 20.6753 20.6819 19.6673 21.3555C18.6592 22.0291 17.474 22.3886 16.2617 22.3886C14.6365 22.3867 13.0784 21.7403 11.9292 20.5911C10.78 19.4419 10.1336 17.8838 10.1317 16.2587V16.2587ZM25.7909 25.2881L25.2911 25.7879C25.2645 25.8145 25.2329 25.8357 25.1981 25.8501C25.1632 25.8645 25.1259 25.872 25.0882 25.872C25.0506 25.872 25.0132 25.8645 24.9784 25.8501C24.9436 25.8357 24.912 25.8145 24.8853 25.7879L20.9153 21.8179C21.2431 21.5431 21.5461 21.2401 21.8209 20.9123L25.7899 24.8813C25.8165 24.908 25.8377 24.9396 25.8521 24.9744C25.8665 25.0092 25.874 25.0466 25.874 25.0842C25.874 25.1219 25.8665 25.1592 25.8521 25.1941C25.8377 25.2289 25.8165 25.2605 25.7899 25.2871L25.7909 25.2881Z" fill="#110F21"/> </svg> </button> </form> </div>
SCSS
style.css.search { form { position: relative; input { width: 100%; height: 50px; color: $color-text; padding: 6px 60px 6px 12px; border: 1px solid $color-border; &::placeholder { color: $color-text; opacity: 1; } } button { position: absolute; top: 0; right: 0; @include center; width: 50px; height: 100%; padding: 0; border: none; background: none; } } }
JSON
index.js"search_placeholder": { "type": "text", "default_value": "Ürünün adını ya da stok kodunu yazınız", "label": "Arama Metni" }, "search_button": { "type": "text", "default_value": "ARA", "label": "Arama Butonu Metni" },
Son güncelleme: