Re: Link Header Logo to Somewhere Different on Certain Pages

Solved

Link Header Logo to Somewhere Different on Certain Pages

pearlerwork
Shopify Partner
76 1 10

We've got a different logo and branding to show on certain pages. See below link:

 

https://www.findmenowthelabel.com/ 

 

Any ideas how we may be able to make it so that the logo on certain page templates goes to a different URL?

 

Page: https://www.findmenowthelabel.com/pages/second-skin

Collection template: https://www.findmenowthelabel.com/collections/second-skin-dresses

Product template: https://www.findmenowthelabel.com/collections/second-skin-dresses/products/fa3602dr 

 

Thank you!

Accepted Solution (1)
gr_trading
Shopify Partner
1919 145 199

This is an accepted solution.

use the below code in header.liquid

 

{%liquid assign logoLink = routes.root_url
  if collection.template_suffix == "different-logo"
    assign logoLink = "https://gitagshop.myshopify.com/blogs/news"
  endif 
%}

 

and replace all href="{{ routes.root_url }}"  with href="{{ logoLink }}" in header.liquid

 

please refer to the below screenshot for reference

 

gr_trading_0-1698045748263.png

 

Hope this will help...

For any custom development WhatsApp or connect at Email ID: gr.trading15@gmail.com for quick consultation. | Shopify Free codes
To support Buy Me a Coffee

View solution in original post

Replies 8 (8)

Dan-From-Ryviu
Shopify Partner
9531 1913 1948

Hi @pearlerwork 

It can be but must to edit your theme liquid file for this function. 

- Helpful? Like and Accept solution! or Buy me coffee
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Ryviu: Aliexpress Reviews - AliExpress Reviews Importer, one-click import aliexpress reviews, export reviews to CSV file.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

PaulNewton
Shopify Partner
7048 629 1481

Hi @pearlerwork That would be an advanced theme customization.

If you need this customization then contact me by mail for services.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.
Contact info in signature.

 

To DIY you'd need to find the logo&link code in the theme files for the header, header.liquid or similar,  and override/replace the default logic that just inserts the logo and shop.url.

You'd probably want to set these as metafields to simplify logic otherwise if you have many of these logo/link replacements you'll end up with an unmanageable amount of if statements.

Something like the following logic you'd need to adapt to fit the themes html:

{% if page.metafields.branding.logo_link != blank and  page.metafields.branding.logo_image != blank %}
{{page.metafields.branding.logo_link }}
{{page.metafields.branding.logo_image }}
{% endif %}

 

Good Hunting.

 

 

 

 

 

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


suyash1
Shopify Partner
9853 1225 1566

@pearlerwork - it can be done, it will need code editing, the thing is how many pages do you have where you want different links? if there are too many then it would not be feasible , if few pages only then code will work easily.

To build shopify pages use pagefly | Contact me - suyash.patankar@gmail.com , My timezone is GMT+5:30. | Support me
pearlerwork
Shopify Partner
76 1 10

Thank you. This is the rule that would be best to apply if that helps? 

 

{% if page.handle contains 'second-skin' or collection.handle contains 'second-skin' or template.name == 'secondskin' %}

gr_trading
Shopify Partner
1919 145 199

Hi @pearlerwork 

 

Request you to refer to the below video to impliment the same.

 

 

Hope this will help...

For any custom development WhatsApp or connect at Email ID: gr.trading15@gmail.com for quick consultation. | Shopify Free codes
To support Buy Me a Coffee
pearlerwork
Shopify Partner
76 1 10

Thank you. I had already changed the logo image, it's just the link location I'd like to change the destination of. So I'd like it to go to a different URL than the homepage!

gr_trading
Shopify Partner
1919 145 199

This is an accepted solution.

use the below code in header.liquid

 

{%liquid assign logoLink = routes.root_url
  if collection.template_suffix == "different-logo"
    assign logoLink = "https://gitagshop.myshopify.com/blogs/news"
  endif 
%}

 

and replace all href="{{ routes.root_url }}"  with href="{{ logoLink }}" in header.liquid

 

please refer to the below screenshot for reference

 

gr_trading_0-1698045748263.png

 

Hope this will help...

For any custom development WhatsApp or connect at Email ID: gr.trading15@gmail.com for quick consultation. | Shopify Free codes
To support Buy Me a Coffee
pearlerwork
Shopify Partner
76 1 10

Thanks for completing this work. It functions perfectly now!