Shopify themes, liquid, logos, and UX
Hi Everyone,
I created a custom navigation for one page which is different from the rest of my site. It works fine on desktop view; however, once I shrink the page or use it on a mobile, the toggle does not display show the dropdown with the menu. The initial code I used to block the main site header is:
<style>
div#shopify-section-header {
display: none;
}
</style>
I'm thinking all I need is to point this hidden feature only to the main header on that page but not the secondary header that I created since it is removing some functions. All of the other buttons work correctly except for this piece. Any help on this would be greatly appreciated. This is the page that is currently giving me issues: https://www.patrickshatner.com/pages/sekse-home
Thanks,
Patrick
oh sorry for that issue i can't see that code but If you're comfortable working with coding languages (eg. HTML, JavaScript, CSS, and Liquid), then you can try to follow the custom coding provided by Custom Mobile Menu Example
Thanks KetanKumar - would that mean that the navigation piece that currently works on desktop would have to be modified separately when making changes? Seems that I am missing one minor detail on the current code that I have since all the functions are present.
yes but i can't see can you please share your used demo custom code ?
Yes definitely. In short, not much custom other than creating a duplicate file of the header section targeted specifically for that page and adding the blocker for the original section header. Thanks for looking at this.
For the Page:
<style>
div#shopify-section-header {
display: none;
}
</style>
{% section 'sekse-header' %}
{% section 'sekse-slideshow' %}
Then the details for the header navigation within 'sekse-header' which is not currently working.
<script
type="application/json"
data-section-type="header"
data-section-id="{{ section.id }}"
data-section-data
>
{
"isFullBleed": {{ section.settings.fullBleed | json }}
}
</script>
<div
class="header-wrapper"
data-header-inner
>
<div class="header{% if section.settings.logo_placement == 'center' %} header--logo-center{% endif %}{% if section.settings.full-width %} header--full-width{% endif %}">
<div class="navigation-toggle" style="{% if section.settings.navigationMainMenu == blank %}visibility: hidden{% endif %}">
<button data-navigation-toggle data-open type="button">
<span class="navigation-toggle-inner">
<span></span>
<span></span>
<span></span>
</span>
</button>
</div>
{% if section.settings.logo_placement == 'center' %}
<div class="header--logo-center-search">
{% render 'search' %}
</div>
{% endif %}
<div class="header-logo{% if section.settings.fullBleed and section.settings.fullBleedLogo and template == 'index' %} overlay-logo--enabled{% endif %}">
{% if section.settings.logo %}
<h2 data-header-logo>
<a href="{{ routes.root_url }}" itemprop="url">
{% assign logoWidth = section.settings.logoWidth | append: 'x' | escape %}
<img class="header-logo-original"
src="{{ section.settings.logo | img_url: logoWidth }}"
srcset="{{ section.settings.logo | img_url: logoWidth }} 1x, {{ section.settings.logo | img_url: logoWidth, scale: 2 }} 2x"
alt="{{ shop.name }}"
itemprop="logo">
{% if section.settings.fullBleed %}
{% if section.settings.fullBleedLogo and template == 'index' %}
<img class="header-logo-fullbleed"
src="{{ section.settings.fullBleedLogo | img_url: logoWidth }}"
srcset="{{ section.settings.fullBleedLogo | img_url: logoWidth }} 1x, {{ section.settings.fullBleedLogo | img_url: logoWidth, scale: 2 }} 2x"
alt="{{ shop.name }}">
{% endif %}
{% endif %}
</a>
</h2>
{% else %}
<h2{% if section.settings.logo_placement == 'left' %} class="logo--left-align"{% endif %} data-header-logo><a href="{{ routes.root_url }}" itemprop="url">{{ shop.name }}</a></h2>
{% endif %}
</div>
<div class="header-tools header-tools--style-{{ section.settings.icon_style }}" data-header-tools>
{% if section.settings.logo_placement == 'left' %}
{% render 'search' %}
{% endif %}
<div class="header-localization">
{% render 'localization-selectors', showLocaleSelector: section.settings.showLocaleSelector, showCurrencySelector: section.settings.showCurrencySelector %}
</div>
<ul>
{% if shop.customer_accounts_enabled %}
<li class="header-account" data-header-account>
<a
href="{{ routes.account_url }}"
aria-label="{{ 'layout.header.account' | t | escape }}"
>
{% if section.settings.icon_style == '0' %}
{{- 'layout.header.account' | t -}}
{% else %}
<svg><use xlink:href="#icon-account-{{ section.settings.icon_style }}"></use></svg>
{% endif %}
</a>
{% render "header-account-dropdown", customer: customer, section: section %}
</li>
{% endif %}
<li class="header-cart">
<a
href="{{ routes.cart_url }}"
aria-label="{{ 'layout.header.cart' | t | escape }}"
{%- if settings.ajax_cart_method == 'drawer' -%}
aria-controls="cartSlideoutAside"
class="slide-menu-cart"
{%- endif -%}
>
{% if section.settings.icon_style == '0' %}
{{- 'layout.header.cart' | t -}}
{% else %}
<svg><use xlink:href="#icon-cart-{{ section.settings.icon_style }}"></use></svg>
{% endif %}
<span class="header-cart-count" data-header-cart-count>
{%- if cart.item_count > 0 %}{{ cart.item_count }}{% endif -%}
</span>
</a>
</li>
</ul>
</div>
</div>
</div>
{% render 'navigation', section: section %}
<style type="text/css">
{% if section.settings.fullBleed %}
{%- capture rgb -%}
{{ settings.fullBleedColor | color_extract: 'red' }},
{{ settings.fullBleedColor | color_extract: 'green' }},
{{ settings.fullBleedColor | color_extract: 'blue' }}
{%- endcapture -%}
@media screen and (min-width: 721px) {
.main-header.is-fullbleed:not(:hover):not(.search-open) .header-logo a,
.main-header.is-fullbleed:not(:hover):not(.search-open) .navigation-list-item a,
.main-header.is-fullbleed:not(:hover):not(.search-open) .header-search-form-style-minimal .form-input,
.main-header.is-fullbleed:not(:hover):not(.search-open) .header-search-form-style-minimal svg,
.main-header.is-fullbleed:not(:hover):not(.search-open) .localization-selector button,
.main-header.is-fullbleed:not(:hover):not(.search-open) .header-tools .header-account>a,
.main-header.is-fullbleed:not(:hover):not(.search-open) .header-tools .header-cart>a,
.main-header.is-fullbleed:not(:hover):not(.search-open) .scroll-left::before,
.main-header.is-fullbleed:not(:hover):not(.search-open) .scroll-right::before
{
color: {{ settings.fullBleedColor }};
-moz-osx-font-smoothing: grayscale;
-moz-font-smoothing: antialiased;
-webkit-font-smoothing: antialiased;
}
.main-header.is-fullbleed:not(:hover):not(.search-open) .header-search-form-style-minimal .form-input::-webkit-input-placeholder { color: {{ settings.fullBleedColor }}; }
.main-header.is-fullbleed:not(:hover):not(.search-open) .header-search-form-style-minimal .form-input::-moz-placeholder { color: {{ settings.fullBleedColor }}; }
.main-header.is-fullbleed:not(:hover):not(.search-open) .header-search-form-style-minimal .form-input::-ms-placeholder { color: {{ settings.fullBleedColor }}; }
.main-header.is-fullbleed:not(:hover):not(.search-open) .header-search-form-style-minimal .form-input::placeholder { color: {{ settings.fullBleedColor }}; }
.main-header.is-fullbleed:not(:hover):not(.search-open) .header-search-submit,
.main-header.is-fullbleed:not(:hover):not(.search-open) .localization-selector button,
.main-header.is-fullbleed:not(:hover):not(.search-open) .header-search-form .form-input {
border-color: {{ settings.fullBleedColor }};
}
}
{% endif %}
i mean which demo do you have use custom navigation?
I am using the navigation that came with template "Capital".
you mean you have used Capital Shopify Theme
if you have default issue can you please contact Theme Support team
Correct, but it is not a default issue since the default navigation works. Adding the code below blocks the original navigation as it is meant to do, but then when adding a duplicate heading code for the specific page the drop down toggle doesn't work due to this added code: <style>
div#shopify-section-header {
display: none;
}
</style>
I can help, it seems you have different navigation and header for Home Page & sekse-home Page and the Hamburger Menu For Mobile Menu is not working on sekse-home. You can connect with me via Whatsapp.
Thank You!
@lennoxox wrote: EmployeeConnectionHi Everyone,
I created a custom navigation for one page which is different from the rest of my site. It works fine on desktop view; however, once I shrink the page or use it on a mobile, the toggle does not display show the dropdown with the menu. The initial code I used to block the main site header is:
<style>
div#shopify-section-header {
display: none;
}
</style>
I'm thinking all I need is to point this hidden feature only to the main header on that page but not the secondary header that I created since it is removing some functions. All of the other buttons work correctly except for this piece. Any help on this would be greatly appreciated. This is the page that is currently giving me issues: https://www.patrickshatner.com/pages/sekse-home
Thanks,
Patrick
it seems you have different navigation and header for Home Page & sekse-home Page and the Hamburger Menu For Mobile Menu is not working on sekse-home.
Correct, having two different menus is my intention. The only thing not working is the toggle for the mobile menu which I am trying to fix. Not sure what's causing the issue.
Would it mean that when making modifications, the navigation element that now functions on desktop would have to be adjusted separately? Since all of the functions are present, it appears that I am missing one tiny aspect in the existing code.
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024