How to edit the liquid files properly?

Solved
New Member
8 0 0

Hello everybody,

 

I hope this finds you well. I am working on shipping a new reviews app but I can't find an answer to these challenges on the forum and hope you can help me with that.

 

My reviews app will be similar to Loox yet will offer an embeddable widget in the store with the possibility of sharing a review using an advanced popup. I can't find how to update the right element in the product liquid file that suits the bottom of the page, does shopify has a theming convention??

 

Also, can't find the right logic to approach when letting the store owner to activate/disactivate globally the application or by product. NB: I know about metafields but don't know if they are the right fit for this situation.

 

Thanks a million!!! 

0 Likes

Success.

Shopify Expert
9974 84 1491

@AbdelilahLbardi wrote:

does shopify has a theming convention??

No. Even if they did the theme code could be completely changed so you should never assume where things are, or the best placement. If you look at the approach that the Shopify review apps takes: give instructions on how to install (and remove if needed) the code snippet. This will be extra effort for the user, but saves your app from popping the widget in a totally crazy place.

 

One approach, create a snippet and put all the custom widget code in that. Have the user then include (using a liquid include) the widget wherever it should go.

 


Also, can't find the right logic to approach when letting the store owner to activate/disactivate globally the application or by product. NB: I know about metafields but don't know if they are the right fit for this situation.

 


You'd know that the data for determining the load either comes from a property on the page itself, or via some offsite ajax call. The offsite won't be the path you want to take, but options are nice.

 

To me a metafield makes the most sense. That metafield could then be used to determine if the widget is added to the page. When your JS runs and no widget is found, just do nothing. If not metafield I guess that you could use a tag, but that does pollute the tag data space so not a fan.

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

Hi Jason,

 

Thanks a million for the given answers, I was looking forward to make a whole installation process for the user but thought it would be awesome to automate this part yet making the users feeling that the installation process is really easy.

 

By now, I guess the best option is to give the user the option of which element the widget has to be in be in.

 

Yet, I agree that requesting settings from an endpoint is not that good at all, will go with metafields so.

 

EDIT: checked your profile rank and I thank you for the help you are providing. Is there any way to get in touche with you in case you don't mind?

0 Likes