Questions tagged [liquid]

1

votes
1

answer
38

Views

Filter Collection Items by page metadata

Context I have a jekyll collection called product-categories in which each file has the following metadata in front matter: _product-categories/filename1.md --- - title - uuid --- I have a page whose front matter contains filenames from this collection (collection array selections are saved by their...
Josh
1

votes
0

answer
31

Views

Paginate highly filtered Jekyll collection

I’m building an ICO Website. The website contains a ‘coins’ collection, this collection contains all the ico coin pages. I have then created pages such as https://moonlandingnetwork.netlify.com/upcomingico , https://moonlandingnetwork.netlify.com/activeico etc to display these coins based on w...
alwingeorge
1

votes
0

answer
147

Views

VScode - No syntax highlighting inside {% schema %} or {% stylesheet %} tags in .liquid file

I've started a new job working on shopify templates and am having trouble getting the syntax highlighting to work in VSCode. I have installed the Liquid Languages Support and Shopify Liquid Template Snippets extensions, but on my .liquid files there is no syntax highlighting inside the {% schema %}...
Davez01d
1

votes
1

answer
104

Views

Jekyll Liquid limit contains

I would like to limit how many posts show which contains the layout project but doing this just limits my posts. If I put the limit:4 after the contains, I'm met with; Liquid Warning: Liquid syntax error (line 50): Expected end_of_string but found pipe in 'post.layout contains 'project' | limit:1' i...
spskeen
1

votes
0

answer
96

Views

Shopify order confirmation email does not shows if condition statement for out of stock product,

My task is fairly straightforward but seems it doesn't. I am attempting to send the order confirmation email for out of stock product i.e whose inventory is zero or less. I am allowing to place out of stock order and wants to send order confirmation email as An order will be dispatched by June 17 in...
amar ghodke
1

votes
1

answer
51

Views

Shopify liquid : cart-template variant is not defined

I am simply allowing to checkout out of stock product to buy. When a customer wants to buy product has inventory less than zero and clicks on view cart from ajax cart, I simply want to show message ' dispatch by 7 June.' in cart-template.liquid.I have applied logic as given below. If required full c...
amar ghodke
1

votes
1

answer
37

Views

How to group Jekyll pages by the first letter of the title?

I'm building a Jekyll site that has a page for each topic. I want to create an alphabetically grouped list of links to each page. For example, if my topic titles are: Aardvark Beatle Catfish Cattle I want to end up with a list of links organised as: A Aardvark B Beatle C Catfish Cattle So far, I ha...
mistakenot
1

votes
0

answer
247

Views

Shopify output line items as json values

I am trying to amend our tracking code for Shopify to output the items in the order, but it's giving me issues as not returning what i want. Any ideas please. It's var pr = values that are not working. The rest is fine and outputs what we need: var of_ssid = 'xxxx'; var cs = '{{ total_price | money_...
Onefeed
1

votes
0

answer
129

Views

Check if variable type is hash or array in liquid

I am attempting to write a somewhat generic layout that can take as a parameter either an array of strings or a hash of options, so you can either do: option: - 'One: This is' - 'Two: Raw HTML' Or you can do: option: One: This is Two: a mapping The reason I want to support both of these is that this...
Paul
1

votes
0

answer
151

Views

Regex Replace or Remove in Liquid Syntax

Can We have something in Liquid syntax for following Regex r = new Regex(@'[^a-zA-Z0-9_. ]+', RegexOptions.Compiled); string result1 = r.Replace('input text', 'replacement text'); Which basically do a Replace or Remove?
0

votes
0

answer
5

Views

How do I use a variable inside an include statement in a Jekyll file?

I have a multilingual Jekyll website and I'm trying to build a page that uses an include that will append a file based on the language used but I'd like to avoid using an if statement. I tried to use the following options without success: {%- assign filename = 'myFile.' -%} {%- assign lang = site.ac...
bemed
1

votes
0

answer
126

Views

How to make picture srcset with media queries in liquid (shopify)

I'm looking to render device specific images for both my products, but also all the content that is uploaded through the customize section in Shopify. I'm looking to generate something like the following: How can this be done in liquid as a reusable snippet for both product images, collection images...
martinsoender
1

votes
0

answer
182

Views

Shopify: Slide show images don't aspect fit to the banner area; they get cropped

I am using shopify theme 'Pop' which comes with a Slick Slider Hero. When the slideshow is opened on a mobile device, it automatically crops my images which I don't want because I added text to the image so it cuts it off (view pic attached) Please let me know what code to add to what liquid/css fil...
MissManihi
1

votes
2

answer
92

Views

How do I make hover attributes permanent? [CSS]

I will be using images as it may be hard to understand otherwise. We have these social icons in the footer of our site that have a lovely hover state, however, I can't seem to replicate it without the hover. Facebook Icon: Hover Inactive: Facebook Icon: Hover Active: I would like to replicate the h...
Leon M
1

votes
0

answer
23

Views

Looping through product images in 4s with an offset

So I've got a carousel with thumbnails in which I'm dynamically pulling in product images. The code looks like this: {{ featured_image.alt | escape }} {% for image in product.images offset:1 %} {{ image.alt | escape }} {% endfor %} {% cycle 'section-group-1': '', '' %} {% for image in product.images...
MariaL
1

votes
1

answer
120

Views

How to check if category/tag exists in Jekyll?

I'm trying to achieve a post header like in the example below: 8/18/2018 | Tags: foo, bar In order to do that I need to make sure tag exists, otherwise | Tags: section waste space in untagged post. After searching the web, I tried this statement: {% if post.tags != nil %} Tags: {% for tag in tags %}...
ege
1

votes
0

answer
130

Views

Updating Cart issue on Shopify Checkout Page

With reference to this page URL: https://shop.betterbody.co/pages/autoship-provitalize Select a bottle, the the page will look like this: checkout page We have an issue on our checkout page when we are about to update the quantity using the + and - buttons. Sometimes it works, sometimes it doesn't....
Nazreen M Daud
1

votes
1

answer
66

Views

How to ignore offset in jekyll when previous post is skipped

i'm trying to create my first blog on jekyll. And i stucked in one stupid thing. so the theme is next: i have a section for one of my categories, let it be 'news': {% for post in site.categories.news limit: 2 offset: 0 %} {% include news-item-col-6.html %} {% endfor %} {% for post in site.categorie...
Nursultan Askaruly
1

votes
0

answer
188

Views

Shopify tag product filter not working with checkbox select

i'm trying to create a set of product filters that will work individually or as multiple selects. For test purposes i've added two sets of checkbox that separate different types of filtering options; Category and Size. When you check one of the checkbox option, the page reloads, but with all of the...
moody1208
1

votes
0

answer
28

Views

Droparea dont function, Jquery -> Drag and drop show image and not upload

i have a small problem - i can add a file on click. only the dropzone dont work. If I drag and drop the file in the browser, will be displayed and not uploaded. $('#trigger-attachment').click(function(event) { if ($('#attachment-1').val() == '') { console.log('trigger 1') $('#attachment-1').click();...
Quixxm
1

votes
0

answer
276

Views

Add Custom Script to Shopify Liquid Section

I am working on OutdoorProducts.Com and we have been provided a custom video player widget. (function(d, s) { __TVPage__ = window.__TVPage__ || {}; __TVPage__.config = __TVPage__.config || {}; __TVPage__.config['carousel-home'] = { loginid: '1759226', channel: {'id':'179996403'}, targetEl : 'carous...
Mario Espinoza
1

votes
2

answer
40

Views

Checking for tag duplicates with jekyll excludes tags that are contained in other tags

I am trying to build a (simple, unweighted) tag cloud with liquid in my jekyll site. The tag cloud renders fine when I use this code: {% assign sitetags = '' %} {% for page in site.pages %} {% for tag in page.tags %} {% unless sitetags contains tag %} {% assign sitetags = sitetags | append:tag | app...
leucotic
1

votes
0

answer
35

Views

Octopress / Jekyll: Liquid tag not parsed before being put into file

Any attempt to use the syntax suggested in the Jekyll docs for creating links to posts, or [Name of Link]({{ site.baseurl }}{% post_url 2010-07-21-name-of-post %}) causes the error Error: Tag '{%%20post_url%202018-12-04-irc-codename-phoenix%20%}' was not properly terminated with regexp: /\%\}/. Rea...
Jackson W
1

votes
1

answer
16

Views

printing unique variants for all products on top of a collection page

I am trying to create a filter on top of a collection page with all the available variants. But, I need them to be formatted nicely so I'm using the following code: {% for product in collections.all.products limit: limit %} {% assign sizes = product.variants | map: 'option1' | uniq %} {% assign co...
MG1
1

votes
1

answer
28

Views

Show custom fields on the collection page in Shopify

I am using a plugin that filters products. This means that products are no longer shown in the traditional product loop. I think the plugin has switched to using javascript to show products on the collection page rather than liquid. For every product on a collection page, I wish to show its colour....
Adam Scot
1

votes
1

answer
52

Views

Jekyll liquid if statement confusion

I'm trying to make a if statement work according to my markdown post's liquid header where if a variable is set to true, do a thing, else and if it doesn't exist do the other thing. Just can't seem to get it to work properly. I've tried changing the if statement to {% unless %}. trying different com...
Michael SanAngelo
1

votes
0

answer
81

Views

How to load jekyll data from sub-folder dynamically using page variable as data file name

I learned how to load data from _data/sub-folder from here as following: site.data[page.folderName].fooList But could not figure out how to load data from _data/sub-folder when using page variable as the data file name. Page front-matter: --- layout: default title: Foo folderName: foo dataFileName:...
Hassan Tareq
1

votes
1

answer
26

Views

XML to CSV with data header using Liquid Data Mapper

I have an XML file that describes a header and a list. I need to generate a CSV file where the first line of the file is constructed from the header information and the subsequent lines of the file constructed from the list. The header has a different number of columns to the list items. This is eas...
A Bridgen
1

votes
0

answer
25

Views

Excluding products from shopify search

I am trying to exclude certain products with a specific tag. I was able to exclude products using {% unless result.tags contains 'wholesale' %} on the search page, but having trouble with the search header. The template I have been modifying is using the raw tag. Anyone got any suggestions? {% raw %...
Megan
1

votes
1

answer
58

Views

Scroll top undefined in shopify site

I am working on an ecommerce store(shopify/liuquid). I want to scroll smoothly to different hashs. Now because this is a CMS, I have had to add some attributes via editor or manually with JS. Here I give it the href $(document).ready(function() { $('.hero__cta').addClass('scroll'); $('.hero__cta')....
ptts
1

votes
1

answer
20

Views

How do i array a collection in 3 cols in liquid by a status

I wanna array my collection in 3 cols, for 3 different statuses. And if there isn't any gig/item with that status, it has to say ' No projects' I have tried this: Up next {% assign next = site.gigs | gig.status == 'Next' | sort: gig.date %} {% if next.gigs.size == 0 %} No projects {% else %} {% for...
Caroline Olivia
1

votes
4

answer
2.4k

Views

Find the width of a left floated list and apply to wrapper div to center it using css - jQuery?

I wish to center a ul in a div that is the left column of a liquid layout. To do so I need to set the width of a div that I've used to wrap the ul. Note: the list items (and content) are retrieved from a database using php. I'm interested in your suggestions on how to do this using jquery. Consider...
Niels
1

votes
1

answer
2.5k

Views

one liquid div with one fixed size div

I am trying to build a layout which has a fixed width div and a liquid width div beside it : the left div is not filling its width, also i want this div to fill whole main div when right div is not present, how can i do it ?
datisdesign
1

votes
1

answer
330

Views

Is it possible to do AJAX calls in a liquid template?

I'm looking at the liquid templating language for Rails apps: http://wiki.github.com/tobi/liquid/ I'd like my users to also be able to make AJAX calls (just like the ones in rails for periodically_call_remote, observe_field, etc). Is this possible? Assuming the rails helpers can be added as filters...
Brian Armstrong
1

votes
1

answer
614

Views

collapsible layouts in flex

I'm just finished my first month of getting to grips with flex. All of my projects so far have be very small fixed sized containers with everything in the application resting in an absolute position. The next up and coming project is going to require a more dynamic layout and need some advice. The...
dubbeat
1

votes
2

answer
1.2k

Views

Generator of templated pages in Jekyll

following the plugins instructions, I build my own generator that creates a template page. However, it doesn't behave like I though. The generated template are not parsed by Liquid and are not rendered after the generation. Do you know how I could do ? Currently by generator is like this: module Jek...
Baptiste Pernet
1

votes
1

answer
543

Views

Implement layout tag for liquid template engine

I want to themed my blog that use liquid template engine, but default, the engine only support some basic tags, I want to write custom tag {% layout 'layout_name' %} Layout file: dark.liquid ... {% content_for_body %} ... And template file: blog.liquid {% layout 'dark' %} welcome to my blog! And out...
noname.cs
1

votes
1

answer
3.3k

Views

I need to center a fixed width div that resides inside a liquid width div

I've got code that looks like this: lcol rcol enter code here So what we're looking at here is a bunch of liquid divs designed to expand with the resolution. Then there's one content box that's a fixed width. I need to center that fixed width box and nothing under the sun will do it. I have been be...
GilloD
1

votes
1

answer
1.5k

Views

Shopify: Product variant id's are outputting as literal strings, not numbers

thanks in advance for taking the time to read this. I'm currently developing a 'Test Shop' through my partners account. Everything in the shop is working as expected accept for my product.liquid file. All of the variant id's for the products are outputting as literal strings, not numbers. I am using...
jonlunsford
1

votes
1

answer
735

Views

Adding overflow-y to block element causes width to decrease.

This is what I have, I have left div, and a right div. The left div is a fixed width, and floated left. The right Div is a 'display: block' to make it full width, and has a margin on the left to compensate for the left div. Both of the boxes have a fixed height, and need to be scrollable (the con...
Hyper

View additional questions