All Projects → culturekings → Shopify Shortcodes

culturekings / Shopify Shortcodes

Licence: mit
Allows you to use Shortcodes within Shopify

Labels

Projects that are alternatives of or similar to Shopify Shortcodes

Slater Theme
Shopify Starter theme based on slate
Stars: ✭ 47 (-53%)
Mutual labels:  liquid
Ajaxify Cart
Ajaxify Your Shopify Cart
Stars: ✭ 71 (-29%)
Mutual labels:  liquid
Garth
🥁 A really basic theme for Jekyll
Stars: ✭ 85 (-15%)
Mutual labels:  liquid
Plankton
Open source simulator for maritime robotics researchers
Stars: ✭ 51 (-49%)
Mutual labels:  liquid
Openshift Migration Best Practices
Best practices for migrating from OpenShift 3 to 4
Stars: ✭ 64 (-36%)
Mutual labels:  liquid
Rustycrate.ru
Русскоязычный сайт о языке программирования Rust
Stars: ✭ 72 (-28%)
Mutual labels:  liquid
Jsx Lite
Write components once, run everywhere. Compiles to Vue, React, Solid, Angular, Svelte, and Liquid.
Stars: ✭ 1,015 (+915%)
Mutual labels:  liquid
Shopify Birthday Suit
Exceedingly bare bones Shopify theme
Stars: ✭ 93 (-7%)
Mutual labels:  liquid
Solid
Liquid template engine in Elixir
Stars: ✭ 68 (-32%)
Mutual labels:  liquid
Smartstore
Open Source ASP.NET Core Enterprise eCommerce Shopping Cart Solution
Stars: ✭ 82 (-18%)
Mutual labels:  liquid
Jekyll Assets
🎨 Asset pipelines for Jekyll.
Stars: ✭ 1,083 (+983%)
Mutual labels:  liquid
Gojekyll
A fast clone of the Jekyll blogging engine, in Go
Stars: ✭ 62 (-38%)
Mutual labels:  liquid
Glim
Static site generator which is semi-compatible with Jekyll
Stars: ✭ 76 (-24%)
Mutual labels:  liquid
Liquid.net
.Net Port of the Liquid template language
Stars: ✭ 47 (-53%)
Mutual labels:  liquid
Site
Stars: ✭ 86 (-14%)
Mutual labels:  liquid
Jekyll Timeline
Timeline / Résumé Theme with Jekyll
Stars: ✭ 46 (-54%)
Mutual labels:  liquid
Shopify Webpack Dev Workflow
Stars: ✭ 71 (-29%)
Mutual labels:  liquid
Scriban
A fast, powerful, safe and lightweight scripting language and engine for .NET
Stars: ✭ 1,360 (+1260%)
Mutual labels:  liquid
Liquid Rails
Renders liquid templates with layout and partial support
Stars: ✭ 91 (-9%)
Mutual labels:  liquid
Shopify Css Import
Add CSS import functionality to Shopify theme development with Grunt.js or Gulp.js
Stars: ✭ 82 (-18%)
Mutual labels:  liquid

Shopify Shortcodes

The purpose of this project is to make advanced html usage available to store owners. This project can simplify galleries, faq, maps, videos and more for the store owner.

Syntax

So quickly some information on syntax. We have tried to keep the system consistent with Wordpress so an example tag is

[youtube width="800" height="500" video="M7lc1UVf-VE"]

The first part is the snippet it is going to load and the rest are variables that you can use within the snippet

The above example will load the snippet shortcode-youtube.liquid from your snippet folder.

It will then pass the variables width, height and video with the respective values.

Activating shortcodes

You must first copy shortcode.liquid and shortcode-render.liquid in to your snippets.

To activate shortcode functionality a change to liquid tags is required where the functionality is required.

{{ page.content }}

Would need to be changed to

{% include 'shortcode' load: page.content %}

Accessing variables in snippets

These variables are available to the snippet by using

{% include 'shortcode-render' render:'width' default:'640' %}

For easy reuse you can simply capture the result in to your own variable with

{% capture youtubeWidth %}{% include 'shortcode-render' render:'width' default:'640' %}{% endcapture %}

Naming convention

All shortcodes are prefixed in the file system with shortcode- so make sure that if you want a shortcode of youtube you create a shortcode-youtube.liquid file.

The purpose of this is to allow store owners to easily find all active shortcodes within a store and avoid collisions with other snippets.

Examples

The youtube example used is available in the examples directory of this project. If you have created a shortcode you would like to share feel free to create a pull request and we will add it in.

Shortcode fallback display

As shopify data can be sent to external applications and used in places where the shortcode is unable to render an optional syntax is available.

It plays on the fact the display of the data will more than likely be in a HTML page and uses the default HTML comment tag to hide the shortcode in places where it has not been rendered.

<!--[youtube width="800" height="500" video="M7lc1UVf-VE"]-->

Using this syntax will however hide it from the WYISWYG editor and make editing by store owners more difficult.

Brackets in content

You may be thinking what happens if I have square brackets in other parts of my content. Not to worry the plugin will only replace square bracket content if it finds an active shortcode. For example

[ Random Content ]

The above won't be replaced with new content unless a shortcode with the name Random exists. There are rare cases when the word you use is a shortcode and this will need to be fixed manually such as

[ youtube is a great channel ]

Would need to be replaced by something such as

( youtube is a great channel )
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].