Solved

I saved a CSS and HTML file in Assets folder; how do I get an url for it?

OasisPromos
Tourist
6 0 4

Hi All,

I am new to this. I wanted to display PMS Color chart on my website and a friend of mine sent me a zip file that has a CSS file and a HTML file and when I open the HTML file on my computer, it works perfectly fine. After reading about theme customization etc on these pages, I added these two files to the Assets folder in my theme. Now, I have no idea how to generate a url that I could use on my website. 

Any help will be appreciated. 

Accepted Solution (1)

KetanKumar
Shopify Partner
36839 3635 11971

This is an accepted solution.

Hello, @OasisPromos 

Welcome to the Shopify community!
and Thanks for your Good question.

can please add this code theme.liquid before </head> 
just change css file name  custom.scss.css to your CSS file name

{{ 'custom.scss.css' | asset_url | stylesheet_tag }}

 

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing

View solution in original post

Replies 10 (10)

KetanKumar
Shopify Partner
36839 3635 11971

This is an accepted solution.

Hello, @OasisPromos 

Welcome to the Shopify community!
and Thanks for your Good question.

can please add this code theme.liquid before </head> 
just change css file name  custom.scss.css to your CSS file name

{{ 'custom.scss.css' | asset_url | stylesheet_tag }}

 

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
OasisPromos
Tourist
6 0 4

Hi @KetanKumar ,

Thank you very much for taking the time and helping me with this question. I added the following line to theme.liquid file:

{{ 'colors.scss.css' | asset_url | stylesheet_tag }} but I still don't know how to generate a page or url address for the file. Can you please guide me.

Once again, thank you very much for your help!

 

OasisPromos
Tourist
6 0 4

Hi @KetanKumar ,

I found the url address. Thank you very much for all your help; I really appreciate it.

Abdul

KetanKumar
Shopify Partner
36839 3635 11971

@OasisPromos 

Thanks for update and compliment 

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
ronald_r
Tourist
5 1 4

Hi, I'm going through the same question: where did you find the url please?

I want to get an always-latest url for the CSS file loaded under the Assets. I edit and update the CSS file a lot, and I don't want to update the link every time after. 

Could you please shed some lights? 

KetanKumar
Shopify Partner
36839 3635 11971

@ronald_r 

Sorry you are facing this issue, it would be my pleasure to help you.

Welcome to the Shopify community!😊
Thanks for your good question.

Please share your site URL,
I will check out the issue and provide you a solution here.

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
ronald_r
Tourist
5 1 4

@KetanKumar 

Hi, thanks for your reply! 

Site URL: https://jgmaker3d.myshopify.com/

So again, for explaining what I'm facing:

I added a CSS file (name: style.css.liquid) on Assets folder, I figured out the link of this file and included in product page's custom HTML section:

<link href="https://cdn.shopify.com/s/files/.../assets/style.css.liquid " doctype="text/css" rel="stylesheet" >

The thing is, when I edit and update the CSS file, the link for the updated file changes with question mark and different version number appended.

I tried to add {{ 'style.css.liquid' | asset_url | stylesheet_tag }} before </head> in theme.liquid; and then change the code on the custom HTML section like this:

<link href="{{ 'style.css.liquid' | asset_url | stylesheet_tag }} " doctype="text/css" rel="stylesheet" >

 It fails to get the latest link of the CSS file. Could you shed some lights? Thanks a lot in advance!

Ronald

KetanKumar
Shopify Partner
36839 3635 11971

@ronald_r 

can you please try this code

{{ 'style.css' | asset_url | stylesheet_tag }}
If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
ronald_r
Tourist
5 1 4

@KetanKumar 

Thanks very much! Issue solved!

Works good now after I remove the .liquid in the code in the theme.liquid, and remove the .liquid in the code in the custom HTML section:

 

{{ 'style.css' | asset_url | stylesheet_tag }} 

 

 So it might turn out that the ".liquid" can not be recognized following the "stylesheet_tag".

I'm not sure if it is the reason, I hope I could have learnt more about this language, but thanks again for the solution!

KetanKumar
Shopify Partner
36839 3635 11971

@ronald_r 

it's my pleasure to help us

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing