Solved

Help editing 404 page with an image

ChelsChels
Excursionist
24 1 22

Hi anyone, I'm trying to add an image to my 404 page, but I don't really know HTML and I forgot where to add quotations or closes to the code (sure I'm explaining incorrectly)

I've already saved the image to my assets which is where I'm sourcing my image from. (If there's a better way to do this as well, let me know.)  After playing around with it I got the page to take off the broken image display to a picture that says no image. 

Here's what I have...

 

<div class="page-width">
<div class="empty-page-content text-center">
<h1>{{ 'general.404.title' | t }}</h1>
{{img src="asset_url | img_tag (cutie-OOPS.jpg)"; /}}
<p>{{ 'general.404.subtext' | t }}</p>
<p>
<a href="/" class="btn btn--has-icon-after">{{ 'general.404.link' | t }}{% include 'icon-arrow-right' %}</a>
</p>
</div>
</div>

Accepted Solution (1)

PaulOwens
Shopify Partner
14 4 20

This is an accepted solution.

Hi @ChelsChels,

 

To display your image you will need to change the image code to this:

 

<img src="{{ 'cutie-OOPS.jpg' | asset_img_url: '600x' }}" alt="Houston we have a problem the page could not be found">

The 600x controls the size of the image. The alt text is optional.

View solution in original post

Replies 3 (3)

PaulOwens
Shopify Partner
14 4 20

This is an accepted solution.

Hi @ChelsChels,

 

To display your image you will need to change the image code to this:

 

<img src="{{ 'cutie-OOPS.jpg' | asset_img_url: '600x' }}" alt="Houston we have a problem the page could not be found">

The 600x controls the size of the image. The alt text is optional.

ChelsChels
Excursionist
24 1 22

Thank you SO MUCH it worked perfectly.

ElOcasoApparel
Tourist
9 0 0

Hi

But where do I have to insert it? 😫 My code looks like this:

 

{
"sections": {
"main": {
"type": "main-404",
"settings": {
"overlay_color": "#ffffff",
"overlay_opacity": "0.35",
"number_size": "200",
"subtitle": "Oops ... it looks like there was a typo somewhere!",
"subtitle_size": "16",
"text_color": "#232323",
"btn_bgc": "#232323",
"btn_txtc": "#ffffff",
"btn_bdc": "#232323",
"btn_bgc_h": "#ffffff",
"btn_txtc_h": "#232323",
"btn_bdc_h": "#232323",
"btn_link_1": "\/",
"btn_text_1": "Return to Store",
"btn_link_2": "shopify:\/\/collections\/all",
"btn_text_2": "Shop the Collections"
}
}
},
"order": [
"main"
]
}

 

 

Please help!