Git Product home page Git Product logo

timber's Introduction

Deprecation warning ⚠️

The Timber theme is no longer being maintained by Shopify. Developers are encouraged to check out Slate - a theme scaffolding and command line tool built for developing Shopify themes.

You can continue to use Timber; however, this repo will not be kept up-to-date with changes in Shopify theme development.


Shopify Timber

Timber is a theme framework for Shopify that helps you get your store up and running quickly. It provides all required theme templates, a starter set of liquid tags, and some basic styles and modules for you to extend on.

Styling and customization is left up to you. Some base styles and helpers are included, but there is no need to remove any code before you start. Simply download and get designing.

Designing a store for a client? Earn revenue through our Partner program.

Ways to Get Started

  • Download the latest release
  • Clone the repo git clone https://github.com/Shopify/Timber.git
  • Or install with Bower bower install timber

Demo Stores

  • Demo Store: A store setup with some products, blog posts, and customer accounts
  • Empty Store: A fresh store, just what you should expect when you install on your new store

For a set of demo products to use during development, download this CSV file and import it on our products page.

Basic structure

├── assets
│   └── Javascript, CSS, and theme images
├── layout
│   ├── theme.liquid
│   └── optional alternate layouts
├── snippets
│   └── custom code snippets
├── spec
│   └── tests and helpers
├── templates
│   ├── 404.liquid
│   ├── article.liquid
│   ├── blog.liquid
│   ├── cart.liquid
│   ├── collection.liquid
│   ├── collection.list.liquid
│   ├── index.liquid
│   ├── list-collections.liquid
│   ├── page.contact.liquid
│   ├── page.liquid
│   ├── product.liquid
│   ├── search.liquid
│   └── customers
│         └── required templates if customer accounts are enabled
├── config.yml
│   └── if using the theme gem (see link under Additional Resources)

i18n testing

Tests make sure there are no missing or extra i18n strings or invalid html in your locale liquid files.

All PRs must pass the tests before being merged. Check the test status when you open a new PR on GitHub, or locally with the following.

  • bundle install to install all the dependecies
  • rspec spec to run all the tests

Additional resources

License

Timber is released under the MIT License.

timber's People

Contributors

afshing avatar benknight avatar blboyle avatar carolineschnapp avatar cshold avatar eswat avatar gavinballard avatar greenboyroy avatar haeky avatar humancopy avatar jonasll avatar jonathanmoore avatar jore avatar jtgrenz avatar jumplink avatar kvs avatar matcaissy avatar mfelser avatar montalvomiguelo avatar mpiotrowicz avatar nathanpjf avatar oksushi avatar paulmason avatar pmeissner avatar rubenbristian avatar schaeken avatar shopify-admins avatar stevebosworth avatar timdmackey avatar xuorig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

timber's Issues

enable us to customize additional checkout buttons

{{ content_for_additional_checkout_buttons }} generates inputs with hardcoded img src that reside on another site:

<input type="image" name="goto_pp" value="paypal_express" src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckoutsm.gif">

Please enable us to use other images, either via settings or simply by using local image assets that we can overwrite.

ajax cart modal qty cutoff if more than one digit

screen shot 2014-06-20 at 11 10 07 am

I can't tell if this is just me; it happens for sure in my shop when switch ajax cart to modal; and if I change ID in demo shop to toggle ajax modal it happens there too -- changing the .cart-row .grid-item sizing to .large--one-half for each element seems to provide enough space

Prepopulate Input Fields

Just a suggestion

On the Contact Us page (and Newsletter Subscribe Form), if a customer is logged in, you can automatically populate input fields like "Email" and "Name" by adding the following:

<input type="text" value="{% if customer %}{{ customer.name }}{% endif %}" .... >
<input type="email" value="{% if customer %}{{ customer.email }}{% endif %}" .... >

No sure if that is creepy or a nice addition?

Parent = wrap {% form 'foo' %} in div with class .form-horizontal ?

Firstly, this is a great development from Shopify and I'm very grateful. I'm excited to jump in and see how it improves workflow!

I usually develop with Bootstrap and they use .form-horizontal also - but one issue I've had is that Shopify Liquid makes adding certain forms like customer registration or contact easier with the tag {% form 'contact' %} which outputs the HTML form tag. This makes it harder to add a class to the HTML <form>.

I notice in the Timber scss file that the class styles are defined either

/* Horizontal Form */ form.form-horizontal, .form-horizontal {

So testing just now I had no problem making a .form-horizontal by wrapping <div class="form-horizontal"> around the desired html <form> in the docs

Most designer/developers should figure this out quickly, but perhaps the docs could specify more clearly what 'parent' means in case of using the Liquid {% form %} tag if that would be your preferred method?

Grid Center

Been trying to push, pull or align but grid--center doesn't work because you've changed all grid-item to float rather than display-block.

Issue with Ajax Checkout (drawer) expansion

On the latest version of Timber, when you have the Ajax drawer enabled, have items in your cart and hit checkout, it does not go to the checkout page, instead the cart expands and is hidden behind the header.
screen shot 2014-08-04 at 11 41 52 pm

Remove CSS reset

Some people love resets, and some normalize. In both cases, your dev inspector ends up looking like this:
screen shot 2014-07-21 at 1 42 39 pm

Why reset everything just to overwrite it a few declarations later? A future version of timber will remove the CSS reset near the top of the file in favour of a minimal normalize and add in specific reset values when elements are defined.

Requests, concerns, etc welcome.

Demo store - Dummy content [Request]

I think it could be very useful for theme developers if the "dummy content" from the demo store was included with Timber or available for download. It's a time saver and good for testing themes.

Prepend the cart dynamically to element

Hi there,

I need to wrap my page into one div as I am using mmenu for a mobile theme. Since ajaxifyShopify prepends the cart to the body it breaks this requirement.

I had a quick look into the source and changed this to make it work:

on line: 273

        // Default settings
        settings = {
            debug: false,
            method: 'drawer', // Method options are drawer, modal, and flip. Default is drawer.
            formSelector: 'form[action^="/cart/add"]',
            addToCartSelector: 'input[type="submit"]',
            cartCountSelector: null,
            cartCostSelector: null,
            toggleCartButton: null,
            btnClass: null,
            wrapperClass: null,
            useCartTemplate: false,
            moneyFormat: '${{amount}}',
            disableAjaxCart: false,
            enableQtySelectors: true,
            prependTo: 'body'
        };

I added the prependTo option

and on line: 461

$(settings.prependTo).prepend(template(data));

I replace the hardcoded 'body' with the added setting.

So I can use it like this

        <script>
            jQuery(function($) {
                ajaxifyShopify.init({
                    prependTo: '.js-cart-container'
                });
            });
        </script>

Hope that helps someone and/or you can roll this into the master.

Cheers

Input Type for External Links - settings.html

Should the input type for fields with external links (like: "Twitter Link" & "Facebook Link") be a "url" rather than "text"?

If set to url it will display a form validation error if the value isn't a proper url. Which may help users to identify problems.

Contact Form

I notice on the Contact form, after you hit submit, if there was a problem (such as a missing required field), it completely deletes all of your information. Which means the user needs to retype there message etc.

Feature: glyphs / credit card icons / etc

you want to bundle a small standard set of fonts/glyphs with this framework? I often pull glyphicons or fontawesome into projects on my own. I would imagine the set you'd need to cover as eComm framework would be much smaller than these sets. To name a few, but you decide:

  • a few directional
  • grid/list toggle
  • mail, phone, search
  • cart (of course)
  • credit card branding
  • social branding
  • account (user, login, logout, home)
  • comment (edit, post, comment, plus/add, delete)

Associating product variants with product images

I think it could be a good idea to incorporate best practice code on how to associate product variants with product images. I had a bit of trouble with this when I did my first Shopify theme, and hopefully a lot of web designers could find such boilerplate code very useful. It’s a nice touch to the user experience.

Edit:
I didn't know about http://apps.shopify.com/variant-images. Looks interesting!

W3C Validation Errors

Hello,

First off, thanks so much for creating Timber. It's really sped up my theme development.

I'm using this as the basis for themes I'm building to sell in either the theme store or on ThemeForest. A large part of the review process for getting approved at TF is the W3C validation. I notice that the Timber theme has a few validation errors.

http://validator.w3.org/check?uri=https%3A%2F%2Ftimber-demo.myshopify.com&charset=%28detect+automatically%29&doctype=Inline&group=0

I wonder if you could address whether or not these are legitimate errors or if the W3C validator is just behind the times. Thanks!

product thumbnails after switch link only to feature img

in the shop.js.liquid to switch main image to thumbnail we have

timber.cache.newImage = $(this).attr('href');
timber.cache.mainImage.attr({ src: timber.cache.newImage });

however, clicking on main image, even after thumbnail switch only links to original mainImage bc we do not change parent href for mainImage. For example, could do:

timber.cache.newImage = $(this).attr('href');
timber.cache.mainImage.attr({ src: timber.cache.newImage });
timber.cache.mainImage.parent().attr({ href: timber.cache.newImage });

still however, the mainImage href loads first to 'original' size but each timber.cache.newImage is linked to 'grande' size. This causes slight issue as clicking on feature image thumbnail vs clicking immediately on full feature image would generate two different links (one to 'original' vs one to 'grande'). Essentially, I think we want ref to three different image links : 'compact' (as thumbs), 'grande' (as mainImage), 'original' (as separate linked page).

In past, to get around this without using js to change urls I have used HTML data-* attributes. Then product.liquid may look like this

<a href="{{ image.src | product_img_url: 'grande' }}" data-original="{{ image.src | product_img_url: 'original' }}" class="product-photo-thumb">
<img src="{{ image.src | product_img_url: 'compact' }}" alt="{{ image.alt | escape }}">
</a>

and shop.js.liquid like this

  // Product Page
  mainImage: $('#productPhotoImg'),
  thumbImages: $('#productThumbs').find('a.product-photo-thumb'),
  newImage: null,
  newImageOriginal: null
  ...
  timber.cache.newImage = $(this).attr('href');
  timber.cache.newImageOriginal = $(this).attr('data-original');
  timber.cache.mainImage.attr({ src: timber.cache.newImage });
  timber.cache.mainImage.parent().attr({ href: timber.cache.newImageOriginal });

let me know suggestions or changes, but I'd be happy to make a PR for this if you wanted?

Only show itemQty if over 1

Hello Timber.

Is there anyway I can modify the code so that it only shows the itemQty if it is over 1?
So if there is one jacket in the shopping cart, it says "jacket", but if there are more, it says "2 x jacket", in the ajaxified cart?

Thank you for your help. :-)

timber.scss.liquid 500 error

Not sure what happend but I just reuploaded timber.scss.liquid and started getting a 500 error.

When I accessed timber.scss.liquid directly, the contents of the file was

"\xE2" from ASCII-8BIT to UTF-8 scss

Not sure if relevant but I tried compiling the scss file locally and I kept on getting indentation errors

$ sass timber.scss.liquid
Syntax error: Inconsistent indentation: 2 spaces were used for indentation, but the rest of the document was indented using 4 spaces.
        on line 18 of timber.scss.liquid
  Use --trace for backtrace.

I fixed this by adding @charset "UTF-8"; to timber.scss.liquid.

.product-price class

.product-price class exists within SCSS section for Product Page styling, however class does not exist on product.liquid.

The corresponding element has already .h2 in markup -- so do you want to:

  • eliminate the styling in SCSS for the class?
  • Change the styling in SCSS to the ID? (I generally prefer to style with classes not IDs)
  • add the class to HTML and style appropriately in SCSS?

...options, options...

Liquid error: wrong number of arguments (2 for 1)

Hey, I've been using Timber to develop a couple of new shops. However I keep randomly running into this error showing up on my pages:

"Liquid error: wrong number of arguments (2 for 1)"

Not entirely sure what could be causing it. I've been using the theme gem tool to sync my theme files back and forth. Any ideas, help or insight would be greatly appreciated

blog-sidebar tags do not work like collection-sidebar tags

currently blog-sidebar pulls tags from blog.tags io blog.all_tags; this is different functionality than currently in collection-sidebar which is collection.all_tags.

also, blog-sidebar does not have a 'catch-all' remove tags link like collection-sidebar does as the first <li>, furthermore bc the tags are not added to the blog breadcrumb, then the only link back to blog is <a> blog title bf the tag

will you look at aligning these two functionalities?

Incorporate Grunt Discussion

Opening the discussion to incorporating Grunt to Timber. Specifically, this task that combines shopify_theme's watch and css concatenation.

This is being proposed because the asset folder cannot have sub folders or use Sass's @import ability. The end result would still be a single .scss.liquid stylesheet.

Pros for including Grunt:

  • Modularize CSS into smaller organized files
  • Promote more modular style definitions
  • Opens up the possibility of customized folder structures during development
  • Potential for other Grunt tasks during development
  • By only concatenating stylesheets and letting Shopify's server render the Sass, no special syntax is needed for theme settings

Cons for including Grunt:

  • Would have to create a src directory, potentially adding confusion
    • Timber should be just as usable without Grunt as with it
  • Could appear more complex to less experienced users
  • Styles edited in the browser template editor would be overwritten the next time the grunt task runs

Questions to be answered:

  1. Should Grunt be included at all?
  2. If Grunt is included, what tasks would be the most useful?

Open to more pros, cons, and questions.

Enable Photo-Swapping on product page in Shopfy Timber

Hello there,
I am new to shopify and have been using the Timber dev theme for my client.

I am on the product page and instead of the default click and switch to “Grande View”

I want the product to Image swap the feature image.

I read this comment in the product.liquid file:

{% comment %}
If we have more than one product image, loop through them and create thumbnails.

By default, images will link to their grande size (600x600).
Thumbnail swapping is enabled in shop.js.liquid.
{% endcomment %}

So I went over to the shop.js.liquid and perhaps its my unfamiliarity with js but I can’t see where to enable the feature.

Here is the code below from the shop.js.liquid file:

window.timber = window.timber || {};

timber.cache = {
// General
html: $('html'),
body: $('body'),

// Product Page
mainImage: $('#productPhotoImg'),
thumbImages: $('#productThumbs').find('a.product-photo-thumb'),
newImage: null
}

timber.init = function () {
timber.cache.html.removeClass('no-js').addClass('js');

// Run on load
timber.productImageSwitch();
}

timber.productImageSwitch = function () {
if ( !timber.cache.thumbImages.length ) {
return;
}

// Switch the main image with one of the thumbnails
// Note: this does not change the variant selected, just the image
timber.cache.thumbImages.on('click', function(e) {
e.preventDefault();
timber.cache.newImage = $(this).attr('href');
timber.cache.mainImage.attr({ src: timber.cache.newImage });
});
}

// Initialize Timber's JS on docready
$(function() {
window.timber.init();
});

Can we have a demo for each Ajax method?

Would it be possible to make the following orange words:

Alt text

... in the Ajax module documentation become links to product pages that show the method in action?

I assume the one Timber demo — looks fantastic by the way — with products: https://timber-demo.myshopify.com/products/womens-long-cardigan uses the drawer method?

The 2 other methods could be enabled in the same account as unpublished themes and you could link to the same product page using ?preview= appendage. Not need to keep lots of shops laying around.

Thanks! :)

Adding modulated asset files

It would help a whole lot if timber comes in modules for easier editing.
Need I say more?

I understand that Shopify has limitations on how to organise its assets folder which greatly limits this. To remedy this we have created a small "clean-timber" repo to show off how this would work in our opinion.
We use grunt to compile all assets into the assets folder while keeping all files modulated within our project. If this, or some version of this idea was to be added into timber I believe the community would benefit from this a lot.

Ajax cart quantities don't validate in Chrome

Ajax quantities over 1 character don't validate in Chrome (and other browsers using new HTML5 validation techniques), and return the "Please match the requested format" warning when trying to submit the cart form.

<html class="no-js">

I'm just wondering why this class (no-js) is assigned to the html tag? It seems that Timber doesn't include Modernizer.

Also adding the following line of code in shop.js.liquid doesn't seem to remove the class (no-js)

$('html').removeClass('no-js');

If you check the rendered source, the class remains, even when the browser supports JS.

I've tested it in both Firefox and Safari (the latest versions) on a Mac.

Maybe I misunderstand how it works?

Currency issue with the Ajax function

@cshold Hey Carson!

When adding to the cart — using Ajax — the cart total is updated but always formatted using ${{amount}} rather than the shop's currency.

If the shop uses Euros:

Alt text

I have not looked further than that for now.

A few notes

You may need to pass the shop's currency to your Ajax init function:

ajaxifyShopify.init({
   moneyFormat: {{ shop.money_format | json }},

( Use the json filter in case people add HTML, so straight quotes, to their money formats. )

Also, wherever you are including {{ 'option_selection.js' | shopify_asset_url | script_tag }} — in the Timber theme, that's in product.liquid — you are resetting Shopify.money_format to ${{amount}}. So if you are using Shopify.money_format in your JavaScript you need to be aware of that reset.

Separate Sass files

I understand that the current single Sass file would be easier for users who aren't familiar with build/task runners and that there are security issues with allowing @import

I was thinking maybe include the separated scss files in a separate folder in the root project directory or maybe bower_components and including a Grunt or Gulp file that would concatenate to /assets/timber.scss.

I think this would allow people who prefer using a single scss file to be unaffected.

selector-wrapper label seems to only work with 2 options

multiple variants are hidden behind a display none, unless there are 2 (or more) options.

suspect it has to do with:
// Hide the variant dropdown if there is only one
if (variant.options.length == 1) {
$('.selector-wrapper').hide();
}

229-232 in product.liquid

add option for linklist control of featured collections?

the current {% for collection in collections %} loops through collections alphabetically; therefore the 'Featured Collections' on index.liquid will always be those first in alphabet. Perhaps we could add functionality that this output could also be controlled by a link-list of five specific collections? This way, if isEmpty then index shows the startup placeholders, if no featured linklist then index shows alpha forloop of five (as is currently), or if featured linklist then index shows those five.

I'd be happy to take a swing at it and PR, I'm going to make the change in my site anyway.

Search Input

Should the input type for the search field be "search" rather than "text"?

Ajaxify cart, wrapper class

Hello.

I have set the wrapperClass to be "site-width" under settings, and then created a class called .site-width {width: 100%; max-width: 1200px; }

My Ajaxified cart has to float left with an absolute position, but within the 1200 px.
However it doesn't work. I don't understand what I am doing wrong.. Can you help me out :-) ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.