Shopify themes, liquid, logos, and UX
Hello,
i know there are similar requests, but none is really answered besides reaching out to an expert.
In our shop basically we want 2 landing pages, one for normal customers and one for wholesale. Each one should have a different menu in the header, because the pages listed in them are specific to B2C or B2B.
Is this possible in any way? I thought maybe if else statement which reacts to the current page and uses a different link list, but i'm not that good with linklists and so on so a little detailed solution would be really awesome.
Thank you very much in advance!
Welcome to the Shopify community!
and Thanks for your Good question.
Please share your site URL,
So I will check and provide a solution here.
It's possible to do two different landing pages, but it would all have to be hard coded in and not through your customize editor. The linklist solution is completely doable though.
You can use customer tags to identify who is a wholesale customer and who isnt. You'd go into wherever your navigation is included, probably the header, and just make a conditional statement around it
{% if customer.tags contains "wholesale" %}
{% assign menu = 'wholesale-menu' %}
{% else %}
{% assign menu = 'normal-menu' %}
{% endif %}
{% for link in linklists[menu].links %}
//code to output your menu items.
{% endfor %}
Hi,
I would also like some help with this. I would like to be able to either remove my navigation header or replace it on certain pages within my site.
Is this possible?
Thanks
What would the code in '//code to output your menu items' look like, I have been looking at this problem for a few days now and I cant figure it out
it can be done some customization code
Hi @CreaWeb ,
Posting to help others in implementing the same.
Please follow the instruction provided in the below video to implement the same.
This example works only for pages created out from a collection, not from "pages".
Does anyone know how to set a different header menu on a different page?
For example, In main page I sell darkroom and photography products so here I have header: Shop, film, Blog and Lab. And in another page I sell prints and books, so I need header menu: Artist, books, prints, and Limited editions.
Hi @Hectorroa ,
It works for everything's just you have to write the code for this.
We can also write a generic code which will work for product, pages, collection and can be maintained from single place. Let me know if you are interested in that code.
Thank you, I tried again and worked perfectly.
Glad it helps, request you to like our post and video.
I need help on my landing page and show a different menu.
Hey @Linden_Creek ,
Video has complete detail how to implement the same, if you want us to implement request you to connect via private msg, email or WhatsApp details are in post footer.
You can make any kind of condition you want around the menus similar to their example, you just have to make the right comparisons using the right objects. Most things in liquid have objects you can reference. It really depends where you are to know what template you're using. So what do you mean by "in the main page" do you mean the homepage? In that case the template's name is index, so you'd say
{% if template.name contains "index" %}
//menu for homepage
{% else %}
//different menu for every other page
{% endif %}
If you're talking about actual pages, meaning they have the "/pages/your-page" extension you can use the pages handle to check:
{% if template.name contains 'page' and page.handle == "your-page" %}
//the menu you want for that specific page
{% else %}
// the menu you want for every other page.
{% endif %}
So in the above statement it makes sure that you're on a page template, and if you had a page called "Your page" the handle would be 'your-page' -- you can find the handle of your page at the bottom in the SEO portion in the page admin, it'll be whatever the end of the url is:
As 2024 wraps up, the dropshipping landscape is already shifting towards 2025's trends....
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024