Shopify themes, liquid, logos, and UX
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!
Solved! Go to the solution
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
Hope this will help...
Hi @pearlerwork
It can be but must to edit your theme liquid file for this function.
- Helpful? Like and Accept solution! Support me! 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.
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
@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.
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' %}
Hi @pearlerwork
Request you to refer to the below video to impliment the same.
Hope this will help...
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!
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
Hope this will help...
Thanks for completing this work. It functions perfectly now!
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024