Adding Custom Fields to the Shopify Dashboard

Shopify Staff
Shopify Staff
5704 0 278

Oh diantre you know what? I saved the key with a leading space in it!

So this works:

{% assign key = ' [p][_t]Ingredients' %}
<p>Ingredients: {{ product.metafields.c_f[key] }}.</p>

Shopify does not trim the white space!

Caroline from http://11heavens.com ∴ mllegeorgesand AT gmail DOT com
1 Like
Shopify Expert
9764 86 1511

I'm doing some cleanup on this over Easter. Will make a new branch for it but the plan is to kill off per product custom fields which will also let me move (unless there's objections) the markers into the description of the master metafield so this:

product.metafields.c_f.[p][_t]Ingredients

can become:

product.metafields.c_f.Ingredients

I have got this roughly implemented already - just need to refine and test to avoid making things go boom. 

The whitespace for the fields is something I can help people avoid adding in error too.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
1 Like
Shopify Expert
9764 86 1511

The new update is live. Now I just need to get cracking on the docs.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
1 Like
New Member
1 0 1

Just as a heads up, the latest edition chrome extension didn't pop up the metafields information on the General Settings page. I thought I was just going crazy until I tried the bookmarklet which worked fine...

This was a first time install so not sure if it's a new issue, or just my particular setup. (Chrome 34.0.1847.116)

1 Like
Shopify Expert
9764 86 1511

This thread is talking about the Custom Fields extension - not ShopifyFD. This does not add a metafield edit box in the settings (though perhaps it should). I'll guess you're talking about the other one so I'll take a quick peek at it just in case there is some quirk. Do note that both the extension and bookmarklet use the same script source so I would have expected it to fail on both.

Thanks for the feedback - don't get much so even false alarms are handy ;)

 

 

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
1 Like
Tourist
13 0 2

Thanks so much for creating this tool! Any idea how to preserve newlines within a text field?

1 Like
Shopify Expert
9764 86 1511

It's not? I have the newlines being saved aok.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
1 Like
Tourist
13 0 2

True, they get saved great, but they don't get outputted to the theme.

1 Like
Highlighted
Shopify Expert
9764 86 1511

Have you tried using the newline_to_br filter on the output?
http://docs.shopify.com/themes/liquid-basics/output#newline-to-br

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
1 Like
Shopify Staff
Shopify Staff
5704 0 278

Oh Jason, I am very much looking forward to the docs!

 

Caroline from http://11heavens.com ∴ mllegeorgesand AT gmail DOT com
1 Like