How can I embed a PDF price list on a hidden page without getting a 404 error?

Hello

I am hoping someone might help.

I am trying to embed a .pdf price list on a hidden page on my site.

I have created the page, and amended the liquid code as follows under the tag.

{% if handle contains 'trade-price-list' %} {% endif %}

However, i get a 404 error when i try and find the page, so I would like some advice please?

Can anyone help?

Many thanks

@SianC

I am unsure about pages but you could create a hidden product or collection. For those if you create a single line text metafield with the namespace and key “seo.hidden” and set it’s value to “1” the product or collection would be hidden from the sitemap and search.

From there you simply need to link to the download in the description or however you were planning to do it.

You can also easily “password protect” pages as well. For example with the use of a cart attribute you can add some Liquid code that checks it for a specific value before loading any of the content and if it’s not there and matching display an input that would set the value before reloading the page.

Hope that helps!

I’m jumping in to shed some light on the metafield method of hiding the products from the search results suggested by @RobDukarski . That’s a great solution, but you may want to use a different metafield type - the “integer” one.

In accordance with the official Shopify documentation, in order to exclude a product from the search results, one has to create a metafield with the following attributes:

1) namespace: “seo”
2) key: “hidden”
3) value: “1”
4) type: “number_integer”

@MetafieldsGuru

Thanks for jumping in and sharing the documentation. Frankly I cannot remember if I had seen that documentation before but I simply shared because I recently (within the last 2 or 3 months if I recall correctly) was made aware of the ability to use that metafield method from other Shopify Partners, and since then I believe I had always used the single line text method for it and that worked for me…

Glad the documentation has been shared and am curious if there are more features and functionality like this that are currently undocumented.

@SianC I definitely agree with @MetafieldsGuru there and you should use the metafield type that follows the documentation because Shopify could block the ability for the single line text value to work at any time.