Build a theme section for a hero Image that will automatically show and hide based on a start and end date. 
Shopify Development news and articles
 
Liquid Weekly

Karl Says


If you are reading this newsletter it means Thanksgiving and BFCM are over - you survived! Also, Butterscotch pie > Pumpkin pie, just my 2 cents.

News & Articles

Shopify App Store. Guide to revenue
SpurIT has been in the Shopify space since 2011. In this series of articles, they share their journey from being a single app provider to developing 38 apps. Learn about:
  • Product and Growth Metrics, what’s the difference and what to track
  • Why product update is a must and how to do this successfully
  • Comparison of app versions
  • Cases studies: how we promoted our apps
Add the power and convenience of scheduling to your Shopify Theme using liquid
Follow TJ as he explains in great detail how to eliminate the inconvenience of having to personally switch out theme elements by building a theme section for a Hero Image that will automatically show and hide based on a start and end date you choose.
Building Better Liquid Arrays
Working with variables in Liquid is a bit of a challenge. It doesn’t seem to have been designed with complex data-manipulation in mind. Luckily David is here to show us a great technique for creating a complex array while also preserving your data types.
Enforcing Modularity in Rails Apps with Packwerk
Packwerk is a static analysis tool used to enforce boundaries between groups of Ruby files. Shopify created this open source tool to build a package system that can be used to guide and enforce boundaries in large scale Rails applications.
Your Local Epidemiologist
Listen, this Covid thing is, how shall we say, not going as anyone would prefer. There's all kinds of information, misinformation, politicization and strong feelings being tossed around. Personally, I'm always on the lookout for voices and sources of information that provide reasonable information in a reasonable manner. I think I found one here. I hope it's helpful to you as you navigate your own course through the challenges we are all facing together.

Code & Tools

Liquid syntax and whitespace control
One of the first things you will notice about the Liquid programming language are the different enclosing braces. What do these braces mean and what are their functions?
Selling Products in Multiple Units
Thomas walks us through selling units of multiple products in this great tutorial that touches on the Liquid and JS code needed to add this feature to your theme.
The Elements of Git
This is not YAGT (yet another git tutorial) The goal of this post is to give you just enough understanding of the git internals that you can build up a correct intuition of what various git commands actually do under the hood. Knowledge is power!

Changelog

API

Updating apps capturing transactions
Apps that omit the authorization or parent_id parameters when capturing transactions can potentially cause errors for merchants who also use an order editing app.
Changes to Cart default bundled section rendering (Ajax API)
Previously, the Cart API's bundled section rendering operated in the context of /cart when no specific sections_url parameter was set. Now, when sections_url isn't set, sections are rendered in the context of the current page, based on the Referer HTTP request header.

Jobs

Front-End, Remote, PT Contract
Aeolidia, an ecommerce design/dev agency, is looking for a freelance front end web developer. This is a part time contract position for retainer work and smaller tasks on Shopify websites, not currently for full website creation projects.
Front-End, Remote
Electric Eye is looking for a full-time Front-end Shopify Developer. Proficiency in the Shopify ecosystem is required. Typical tasks include Shopify theme development, general site maintenance, custom feature creation, troubleshooting, and QA; all working alongside the lead developer and project managers.

Tip of the Week


Find and replace a pattern in a codebase with capture groups

Sure, you can do this with your editor, but did you know you can quickly and easily replace a pattern of text from the command line?

Check out this excellent tip from Will Keleher:

git grep -l pattern | xargs gsed -ri 's|pat(tern)|\1s are birds|g'

  • git grep -l: make sure we're only looking for files in our codebase (ag -l is another good option)
  • xargs: allow running this with gsed -i
  • gsed -i: edit files (default mac sed is bad, so gnu-sed is essential)
  • gsed -r: use regular expression for the pattern to allow capture groups
  • s|: the first character after the s is used as the delimiter. / is pretty consistently annoying because it's used in file paths & urls.
  • gsed '...': the single quotes are important to avoid escapes
  • 's|pat(tern)|\1s are birds|g': being able to easily use capture groups in a find and replace is amazing
  • |g: replace this multiple times in a line


Source: Will Keleher's article on Bash Patterns