Adding an extra product description box to product template and dashboard

Highlighted
New Member
13 0 0

Hi

I'm trying to add an extra product description box to my template which can be completed from the shopify dashboard. Has anyone else had any success with something similar and if so how is it done?

Many Thanks for any help received.

0 Likes
Highlighted
Shopify Partner
385 0 57

Hello Brannon125,

The product description box allows you to input html code, so you could add two divs and control them with JS/CSS

or

Have you though about metafields? There are number of metafield editors out there that could help you archieve this and then output it to the template.

Hope this helps you to get started.

Kasimir

"Good design is good business"
0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
400 0 68

Hi Brannon,

Britton here with the Shopify support team

It's not actually possible to change around how the Shopify admin looks or add extra sections in there. That doesn't mean we can't do some hacks to get what you want though!

What we need is to decide on a keyword that will split your product content in half so you can have two sections. Lets assume you are going to use this: ~section 2~. What we want to do to get our two sections now is change around the product.liquid file to do the actual splitting. I'm not sure what theme you are using so I can't give completely specific advice but you want to locate the {{ product.description }} object. Replace that object with the following code:

{{ product.description | split: '~section 2~' | first }}

That will now only output everything in the product description above our keyword. To output the rest all you need to do is create a new element that houses this code:

{{ product.description | split: '~section 2~' | last }}

That should output everything after the keyword. Voila! You now have two product description sections in the admin without actually having to change how the admin looks. Remember to always back up your theme by duplicating it before making any changes!

I hope that helps!

-Britton

Britton Shopify Guru
3 Likes
Highlighted
New Member
13 0 0

Hi Kasimir, Thanks for the lightning response!

The description boxes are in different places on the layout so option 1 is no go, but I now know that it's a metafield so that's a start. I had a look at metafields but could only find code where the metafield had specific content rather than allowed content to be added via the product page wizard. I will investigate....

Many Thanks for your help.

0 Likes
Highlighted
New Member
13 0 0

Excellent. Thanks Britton. I will get on that tonight and let you know how I get on.

Your help is very much appreciated:)

0 Likes
Highlighted
Shopify Partner
385 0 57

@Brannon125, please bare in mind that the text editor for description is rich text. So any additional paragraph end tags etc will need to be sorted aswell, if you go with what @Britton suggested.

"Good design is good business"
0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
400 0 68

Hi again,

Kasmir is quite right! If you are going to do what I suggested you are best to do it in the html view and make sure that all the tags are closed up before the keyword and reopened afterwards. Otherwise unlclosed tags could wreak havoc on your page layout.

Good catch Kasmir!

-Britton

Britton Shopify Guru
0 Likes
Highlighted
New Member
13 0 0

Thanks Britton, worked like a dream. I edited the description in the html view and just put the tag ~section 2~ in where I wanted to split the text. I added the code into the product.liquid file and happy days!

I'm not sure about closing tags though? Should I have tags around the ~section 2~ code? Seems to work OK without........

Thanks for your help, much appreciated:)

Cheers, Lee

0 Likes
Highlighted
Shopify Partner
385 0 57

Hello again Brannon125,

I can assist you with what I said previously.

If you do it in the HTML view and add the section tag in that, it will be fine without any additional paragraph tags. You just got to remember to always edit the text in HTML view and not TEXT view. 

As the editor is a rich editor (in text view), it would have added a paragraph before and after the section, this is not needed and would break the layout, when it breaks the text into two parts.

You just need to close any tags open before ~section 2~

Hope this clears it for you,
Kasimir

 

"Good design is good business"
0 Likes
Highlighted
New Member
13 0 0

All good. Thanks Kasimir.

0 Likes